catalin-s Posted December 31, 2012 Share Posted December 31, 2012 In Schema of URLs / Route to products, I’ve changed the {category:/}{id}-{rewrite}{-:ean13}.html to {category:/}{id}-{rewrite}{-:ean13} but the product pages are still containing the “.html” at the end of the friendly URLs. I have this issue after upgrading to PrestaShop 1.5.3.0 from 1.5.2.0 where the .html was not appearing in the product pages friendly URLs. Any ideas how to fix this? Cheers, Adrian. Link to comment Share on other sites More sharing options...
Site Posted December 31, 2012 Share Posted December 31, 2012 (edited) Hi, Have you tried the usual clear cache, force compile smary & dont use cache etc? Edited December 31, 2012 by Site (see edit history) Link to comment Share on other sites More sharing options...
catalin-s Posted January 1, 2013 Author Share Posted January 1, 2013 Yes, I did it and even manual delete all data in the folders (except index.php) cache/smarty/cache cache/smarty/compile But no luck. The product pages are still appearing with the .html in the URLs Any other ideas? Cheers, Adrian. Link to comment Share on other sites More sharing options...
shoulders Posted January 9, 2013 Share Posted January 9, 2013 same in 1.5.3.1 did anyone get any solutions? Link to comment Share on other sites More sharing options...
pepfoto Posted January 10, 2013 Share Posted January 10, 2013 This is NOT ACCEPTABLE!!! All of our hard SEO work is now totally wasted because PS1.5.3 destroys the URLS when upgraded. If I find a solution I will post it. If not, I am going to waste hundreds of hours of work and miss a potentially very large income Link to comment Share on other sites More sharing options...
shoulders Posted January 10, 2013 Share Posted January 10, 2013 (edited) try this solution i found in the forge http://forge.prestas...8#comment-66758 Edited January 10, 2013 by shoulders (see edit history) Link to comment Share on other sites More sharing options...
pepfoto Posted January 10, 2013 Share Posted January 10, 2013 (edited) That is not a solution, that is the description of the cause of the problem. I found a fix: backup classes/php and replace it with a copy of classes/dispatcher.php from version 1.5.2. For now, it seems to work. ///// SORRY I didnt see the actual fix due to the page scrolling down. However, my fix works too. Edited January 10, 2013 by pepfoto (see edit history) Link to comment Share on other sites More sharing options...
shoulders Posted January 10, 2013 Share Posted January 10, 2013 thanks for the fix, but mine was also a fix This code was put at the wrong place. Move it under line 397 : Link to comment Share on other sites More sharing options...
pepfoto Posted January 10, 2013 Share Posted January 10, 2013 (edited) thanks for the fix, but mine was also a fix This code was put at the wrong place. Move it under line 397 : Yeah, I saw, when I scrolled up, sorry for the confuse. Both work but yours might be the safer choice. Edited January 10, 2013 by pepfoto (see edit history) Link to comment Share on other sites More sharing options...
Whispar1 Posted March 11, 2013 Share Posted March 11, 2013 (edited) I hate to dredge up an older post but this is an issue for my shop (1.5.3.1). I moved the code as per instructions in the forge link and confirmed schema code in BO as indicated but still am getting .html on product pages. Did force compile, cleared cache, etc. but to no avail. Any thoughts? Solved: Forge comment said: P.S BO->Schema of URLs->Route to Product URL should be set as {categories:/}{id}-{rewrite}{-:ean13}.html to make it work. Instead - you should remove (as OP stated) .html from {categories:/}{id}-{rewrite}{-:ean13}.html Edited March 11, 2013 by Whispar1 (see edit history) Link to comment Share on other sites More sharing options...
shoulders Posted March 11, 2013 Share Posted March 11, 2013 currently on the 1.5.3.1 the custom URL's do not work. i edited the Dispatcher.php itself (not the recommended way). I altered the default routes there and that worked. PS might of fixed it in the new version but i could not get the code in the forge to work properely either. look at this thread http://www.prestashop.com/forums/topic/215984-schema-of-urls-not-updating/ Link to comment Share on other sites More sharing options...
Whispar1 Posted March 22, 2013 Share Posted March 22, 2013 Just saw this now - thanks for the link shoulders. My urls are working now by combining the git code and editing the rewrite rule in the BO as indicated in my post above. Now the only problem I have now is google is showing duplicate meta desc and titles in GWT not to mention over a 100 404's because both the .html version and the non .html versions are showing up which is strange because trying to access the .html version of a page gives a 404 as expected so how is google seeing the .html version? For example: GATSBY Duvet Set - Whispar Design /duvet-bedding/36-gatsby-duvet-set.html /duvet-bedding/36-gatsby-duvet-set I have tried a standard redirect rewrite rule in .htaccess for .html to non html but it didn't like it so I am not sure what to do next. Link to comment Share on other sites More sharing options...
skyavis Posted April 20, 2013 Share Posted April 20, 2013 Tested on 1.5.3 First install: http://www.prestasho...number-for-v15/ Then try this .... {category}/{-:ean13}{rewrite}/ This worked for me! Link to comment Share on other sites More sharing options...
juanveiss Posted December 19, 2013 Share Posted December 19, 2013 I fixed it overriding Dispatcher : override/classes/Dispatcher.php <?php class Dispatcher extends DispatcherCore { /** * Load default routes group by languages */ protected function loadRoutes() { $context = Context::getContext(); // Load custom routes from modules $modules_routes = Hook::exec('moduleRoutes', array(), null, true, false); if (is_array($modules_routes) && count($modules_routes)) foreach($modules_routes as $module_route) foreach($module_route as $route => $route_details) if (array_key_exists('controller', $route_details) && array_key_exists('rule', $route_details) && array_key_exists('keywords', $route_details) && array_key_exists('params', $route_details)) { if (!isset($this->default_routes[$route])) $this->default_routes[$route] = array(); $this->default_routes[$route] = array_merge($this->default_routes[$route], $route_details); } // Set default routes foreach (Language::getLanguages() as $lang) foreach ($this->default_routes as $id => $route) $this->addRoute( $id, $route['rule'], $route['controller'], $lang['id_lang'], $route['keywords'], isset($route['params']) ? $route['params'] : array() ); // Load the custom routes prior the defaults to avoid infinite loops if ($this->use_routes) { // Get iso lang $iso_lang = Tools::getValue('isolang'); $id_lang = $context->language->id; if (!empty($iso_lang)) $id_lang = Language::getIdByIso($iso_lang); // Load routes from meta table $sql = 'SELECT m.page, ml.url_rewrite, ml.id_lang FROM `'._DB_PREFIX_.'meta` m LEFT JOIN `'._DB_PREFIX_.'meta_lang` ml ON (m.id_meta = ml.id_meta'.Shop::addSqlRestrictionOnLang('ml').') ORDER BY LENGTH(ml.url_rewrite) DESC'; if ($results = Db::getInstance()->executeS($sql)) foreach ($results as $row) { if ($row['url_rewrite']) $this->addRoute($row['page'], $row['url_rewrite'], $row['page'], $row['id_lang']); } // Set default empty route if no empty route (that's weird I know) if (!$this->empty_route) $this->empty_route = array( 'routeID' => 'index', 'rule' => '', 'controller' => 'index', ); // Load custom routes foreach ($this->default_routes as $route_id => $route_data) if ($custom_route = Configuration::get('PS_ROUTE_'.$route_id)) foreach (Language::getLanguages() as $lang) $this->addRoute( $route_id, $custom_route, $route_data['controller'], $lang['id_lang'], $route_data['keywords'], isset($route_data['params']) ? $route_data['params'] : array() ); } } } Link to comment Share on other sites More sharing options...
eugeniac Posted January 7, 2015 Share Posted January 7, 2015 I find that Prestashop is not friendly at all. I´m not webmaster and last time I changed code, my store disappeared. Link to comment Share on other sites More sharing options...
Recommended Posts