Number Nine Posted June 28, 2010 Share Posted June 28, 2010 Hello,Is there a way of removing /content/ from friendly URLs, so that they are more SEO friendly?Actually, instead ofhttp://www.mysite.com/content/friendly_urlI would like to have http://www.mysite.com/friendly_urlI know how to change the .htaccess file, but I have not succeeded in changing links.Thank you. Link to comment Share on other sites More sharing options...
rocky Posted June 29, 2010 Share Posted June 29, 2010 That directory is required so that PrestaShop can distinguish between CMS pages and categories. If you removed it, PrestaShop wouldn't know whether to search for a CMS page with the provided ID or a category with the provided ID. Link to comment Share on other sites More sharing options...
Number Nine Posted June 29, 2010 Author Share Posted June 29, 2010 Thank you rocky for your quick reply. I understand the situation.Do you think we might change /content/ into something else, for instance /services/, /products/ or in any case /one-of-my-keywords/, so that the extra level /---/ could be exploited for SEO purposes, instead of being only 'extra weight' on the URL? Link to comment Share on other sites More sharing options...
rocky Posted June 29, 2010 Share Posted June 29, 2010 Yes, you can do that. You'll need to change "content" in "^content/" in the .htaccess file to another word and then change "content/" in the getCMSLink() function in classes/Link.php to match. Link to comment Share on other sites More sharing options...
Number Nine Posted June 29, 2010 Author Share Posted June 29, 2010 Great!Thanks for the clear explaination. It works fine! Link to comment Share on other sites More sharing options...
rocky Posted June 30, 2010 Share Posted June 30, 2010 If your issue is resolved, please edit your first post and add [sOLVED] to the front of the title. Link to comment Share on other sites More sharing options...
Number Nine Posted June 30, 2010 Author Share Posted June 30, 2010 Ok rocky, thank you for telling me. I hope I have done it right. Link to comment Share on other sites More sharing options...
Arkadia Posted November 26, 2011 Share Posted November 26, 2011 Hi Rocky, I'm having an issue with friendly urls and my post isn't getting responses. You seem like a friendly url rockstar. lol. Please take a look at my post? Would appreciate your assistance very much! http://www.prestashop.com/forums/topic/143069-cms-pages-friendly-url-breaking-links/page__p__687561?do=findComment&comment=687561 Apologies if I'm breaking forum rules posting here? Link to comment Share on other sites More sharing options...
HandCraft Posted March 15, 2012 Share Posted March 15, 2012 Hi Rocky, Enabling Friendly URL from BO-Preference, how exactly affects site performance? If your issue is resolved, please edit your first post and add [sOLVED] to the front of the title. Link to comment Share on other sites More sharing options...
seelk Posted October 22, 2012 Share Posted October 22, 2012 Hi @rocky, I have question about your post: Yes, you can do that. You'll need to change "content" in "^content/" in the .htaccess file to another word and then change "content/" in the getCMSLink() function in classes/Link.php to match. because i`d like to remove 'content' from url but no change so is possible? I try remove 'content' from file /classes/Link.php: public function getCMSLink($cms, $alias = null, $ssl = false, $id_lang = NULL) { $base = (($ssl AND Configuration::get('PS_SSL_ENABLED')) ? Tools::getShopDomainSsl(true) : Tools::getShopDomain(true)); if (is_object($cms)) { return ($this->allow == 1) ? ($base.__PS_BASE_URI__.$this->getLangLink((int)($id_lang)).'[b]content[/b]/'.(int)($cms->id).'-'.$cms->link_rewrite) : ($base.__PS_BASE_URI__.'cms.php?id_cms='.(int)($cms->id)); } if ($alias) return ($this->allow == 1) ? ($base.__PS_BASE_URI__.$this->getLangLink((int)($id_lang)).'[b]content[/b]/'.(int)($cms).'-'.$alias) : ($base.__PS_BASE_URI__.'cms.php?id_cms='.(int)($cms)); return $base.__PS_BASE_URI__.'cms.php?id_cms='.(int)($cms); } on public function getCMSLink($cms, $alias = null, $ssl = false, $id_lang = NULL) { $base = (($ssl AND Configuration::get('PS_SSL_ENABLED')) ? Tools::getShopDomainSsl(true) : Tools::getShopDomain(true)); if (is_object($cms)) { return ($this->allow == 1) ? ($base.__PS_BASE_URI__.$this->getLangLink((int)($id_lang)).'/'.(int)($cms->id).'-'.$cms->link_rewrite) : ($base.__PS_BASE_URI__.'cms.php?id_cms='.(int)($cms->id)); } if ($alias) return ($this->allow == 1) ? ($base.__PS_BASE_URI__.$this->getLangLink((int)($id_lang)).'/'.(int)($cms).'-'.$alias) : ($base.__PS_BASE_URI__.'cms.php?id_cms='.(int)($cms)); return $base.__PS_BASE_URI__.'cms.php?id_cms='.(int)($cms); } but isn`t good solution for my problem, do you have any idea? Link to comment Share on other sites More sharing options...
thankisk Posted May 23, 2013 Share Posted May 23, 2013 Hi Rocky, I applied your solution and it is giving me the error like: Missing category ID. One more thing, I have also edited the Link.php file before to remove the ids from the url for SEO purpose so is it due to this? and if yes then is there solution for this? Thanks and waiting for your answer.... Link to comment Share on other sites More sharing options...
Recommended Posts