fitgura Posted July 30, 2010 Share Posted July 30, 2010 Hi all!I just imported my products via csv (what contains : id; name; ean13; price; quantity;Evrything works fine, but I wanted to switch on the frendly url option. 1. I mde a .htacces file2 I generated the htaccess codeWhat I see now:I see in the category: yoursite.com/5-categorynamebut I could need just the yoursite.com/categoryname without the ID codeand if I click in one of the product details I see the nextyoursite.com/categoryname/1-productname-prductEAN13code.htmlbut I could need it without the ID and without the EAN13 codeIs this possible to do it???because I check in BO the frendly url ani it just contains the name without ID and EAN, so why it put in the html link??can I modify somehow to see the desired url without unnecessary IDs and EAN????my code: # .htaccess automaticaly generated by PrestaShop e-commerce open-source solution # http://www.prestashop.com - http://www.prestashop.com/forums # URL rewriting module activation RewriteEngine on # URL rewriting rules RewriteRule ^([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /img/p/$1-$2$3.jpg [L,E] RewriteRule ^([0-9]+)\-([0-9]+)/([_a-zA-Z0-9-]*)\.jpg$ /img/p/$1-$2.jpg [L,E] RewriteRule ^([0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /img/c/$1$2.jpg [L,E] RewriteRule ^lang-([a-z]{2})/([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$3&isolang;=$1$5 [L,E] RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$2&isolang;=$1$4 [L,E] RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /category.php?id_category=$2&isolang;=$1 [QSA,L,E] RewriteRule ^([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$2$4 [L,E] RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$1$3 [L,E] RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /category.php?id_category=$1 [QSA,L,E] RewriteRule ^content/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /cms.php?id_cms=$1 [QSA,L,E] RewriteRule ^([0-9]+)__([a-zA-Z0-9-]*)(.*)$ /supplier.php?id_supplier=$1$3 [QSA,L,E] RewriteRule ^([0-9]+)_([a-zA-Z0-9-]*)(.*)$ /manufacturer.php?id_manufacturer=$1$3 [QSA,L,E] RewriteRule ^lang-([a-z]{2})/(.*)$ /$2?isolang=$1 [QSA,L,E] # Catch 404 errors ErrorDocument 404 /404.php Link to comment Share on other sites More sharing options...
fitgura Posted July 30, 2010 Author Share Posted July 30, 2010 nobody knows??how to take off ID code and ean13 from frendly url?? Link to comment Share on other sites More sharing options...
fitgura Posted July 30, 2010 Author Share Posted July 30, 2010 nobody knows, what is that????????? Link to comment Share on other sites More sharing options...
fitgura Posted July 30, 2010 Author Share Posted July 30, 2010 please help.........meeeeeeeee Link to comment Share on other sites More sharing options...
rocky Posted July 31, 2010 Share Posted July 31, 2010 This question has been asked many times before. It has even been answered by the PrestaShop team. See my post here. Link to comment Share on other sites More sharing options...
fitgura Posted July 31, 2010 Author Share Posted July 31, 2010 Ok. I tought it.... but even I don't know how to remove the ean13-code from the product link!!!! Link to comment Share on other sites More sharing options...
rocky Posted July 31, 2010 Share Posted July 31, 2010 You'll need to change line 45 in classes/Link.php (in PrestaShop v1.3.1) 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...
fitgura Posted July 31, 2010 Author Share Posted July 31, 2010 rocky! you are a hero!!thank you very mutch!!! It works fine now!!!! Link to comment Share on other sites More sharing options...
Patric Posted August 2, 2010 Share Posted August 2, 2010 So I mark the topic as [solved].Please, next time, do it by yourself by adding [solved] at the beginning of your topic's title by editing your first post ! Thanks. ;-)Please read the PrestaShop.com forum's rules and advice for a better use Link to comment Share on other sites More sharing options...
Recommended Posts