rv01 Posted August 14, 2010 Share Posted August 14, 2010 Hi,the fiendly url generation includes the category name in each product "friendly url".Where can I customize that, i.e. just having the product name in the generated url?Thanksnaturelore.com Link to comment Share on other sites More sharing options...
rocky Posted August 15, 2010 Share Posted August 15, 2010 There is no way to change the format of friendly URLs without modifying code, so I don't think it is a good idea to do it unless it is really necessary. If it is, you can change line 45 of classes/Link.php from: return ($this->allow == 1)?(_PS_BASE_URL_.__PS_BASE_URI__.$lang_link.(($id_product->category != 'home' AND !empty($id_product->category)) ? $id_product->category.'/' : '').intval($id_product->id).'-'.$id_product->link_rewrite.($id_product->ean13 ? '-'.$id_product->ean13 : '').'.html') : to: return ($this->allow == 1)?(_PS_BASE_URL_.__PS_BASE_URI__.$lang_link/*.(($id_product->category != 'home' AND !empty($id_product->category)) ? $id_product->category.'/' : '')*/.intval($id_product->id).'-'.$id_product->link_rewrite.($id_product->ean13 ? '-'.$id_product->ean13 : '').'.html') : and line 48 from: return ($this->allow == 1)?(_PS_BASE_URL_.__PS_BASE_URI__.$lang_link.(($category AND $category != 'home') ? ($category.'/') : '').intval($id_product).'-'.$alias.($ean13 ? '-'.$ean13 : '').'.html') : to: return ($this->allow == 1)?(_PS_BASE_URL_.__PS_BASE_URI__.$lang_link/*.(($category AND $category != 'home') ? ($category.'/') : '')*/.intval($id_product).'-'.$alias.($ean13 ? '-'.$ean13 : '').'.html') : Link to comment Share on other sites More sharing options...
tomerg3 Posted August 15, 2010 Share Posted August 15, 2010 If you make they default category "Home" the URL will not include a category name.It's generally better to have more keywords in the URL, and having the category name in there can only help... Link to comment Share on other sites More sharing options...
rv01 Posted August 15, 2010 Author Share Posted August 15, 2010 Thanks for the modification.I want that because having the categories in the products URL is considered as OVER optimization (SEO).tbd Link to comment Share on other sites More sharing options...
Mallee Boy Posted November 25, 2010 Share Posted November 25, 2010 I see two differing opinions in the comments above. I have a question. Does it make any real difference to google and your keywords whether you use the home category or a sub category in your url?For example:http://www.gamesfromeverywhere.com.au/chess-sets/232-chess-set-polish-kings.htmlandhttp://www.gamesfromeverywhere.com.au/232-chess-set-polish-kings.htmlThanks. Link to comment Share on other sites More sharing options...
tomerg3 Posted November 25, 2010 Share Posted November 25, 2010 From my experience, keywords in the URL help with SEO, so having the category name there will help. Link to comment Share on other sites More sharing options...
rv01 Posted November 26, 2010 Author Share Posted November 26, 2010 Gathered from many sources this is the summary for URL:Keyword should be in URL, first place (so category or product number IS a nuisance!) Keep it short, less than 50 char Use hyphens to separate words Use 2 or 3 hyphens 4 or more hyphens is bad. So, again I say that putting the category number as the first word in the URLs is bad, same when Prestashop puts the product number first,because you should put the product name (= keyword) first.Cheers Link to comment Share on other sites More sharing options...
Mallee Boy Posted November 26, 2010 Share Posted November 26, 2010 rv01,Is there a way to make this happen without affecting the structure of your site? Is it possible to have product numbers at the end? Link to comment Share on other sites More sharing options...
rv01 Posted November 26, 2010 Author Share Posted November 26, 2010 Hi David,I think you have to change the file ".htaccess" and re-order the URL rewriting rules lines.I'll try on my local test instance of the shop to see if it's enough.I would like a comment from a Prestashop specialist/moderator.There are so many things "they" should put in the BO parameters to avoid us to change the code.Even this forum text message editor looks quite old fashioned, is bugged and not user friendly, and have strange behavior. (Beside, the forum is an absolute must).Cheers,Rene Link to comment Share on other sites More sharing options...
Mallee Boy Posted November 26, 2010 Share Posted November 26, 2010 Thanks Rene. I look forward to your reply. Link to comment Share on other sites More sharing options...
rv01 Posted November 27, 2010 Author Share Posted November 27, 2010 Hi David,I removed the product id number in classes/link.php , URL building is OK but then the page is not found anymore.It would be nice to put (in the URL construction) the product name before the product number,but I don't know how to achieve this.Can you try with a new post to ask specifically this?CheersPS: removing the category worked well as explained here above. Link to comment Share on other sites More sharing options...
Mallee Boy Posted November 27, 2010 Share Posted November 27, 2010 Thanks Renee. Getting advice on what google likes nd does not like is often difficult given the conflicting opinions across the web. Link to comment Share on other sites More sharing options...
rocky Posted May 10, 2011 Share Posted May 10, 2011 See my post here. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now