krat Posted May 23, 2011 Share Posted May 23, 2011 How can i get friendly urls without the ID dbase numbers in it?http://webshop.startshow.nl/content/about-us instead of http://webshop.startshow.nl/content/4-about-us Link to comment Share on other sites More sharing options...
Mr S Posted May 10, 2012 Share Posted May 10, 2012 (edited) FREE module available now: http://www.prestashop.com/forums/index.php?/topic/110922-friendly-urls-without-id-number/page__view__findpost__p__883380 Here is what i got: 1st file: ./controllers/ProductController.php update the function preProcess() public function preProcess() { if ($id_product = (int)Tools::getValue('id_product')) { $this->product = new Product($id_product, true, self::$cookie->id_lang); } else //remove link id by Ha!*!*y { $id_product = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' SELECT `id_product` FROM `'._DB_PREFIX_.'product_lang` WHERE `link_rewrite` = \''.Tools::getValue('product_name_seo').'\''); $this->product = new Product($id_product, true, self::$cookie->id_lang); } //remove link id by Ha!*!*y if (!Validate::isLoadedObject($this->product)) { header('HTTP/1.1 404 Not Found'); header('Status: 404 Not Found'); } else $this->canonicalRedirection(); parent::preProcess(); } 2nd file: ./classes/Link.php update the function getProductLink() public function getProductLink($id_product, $alias = NULL, $category = NULL, $ean13 = NULL, $id_lang = NULL) { global $cookie; if (is_object($id_product)) { $link = ''; if ($this->allow == 1) { $link .= (_PS_BASE_URL_.__PS_BASE_URI__.$this->getLangLink((int)$id_lang)); if (isset($id_product->category) AND !empty($id_product->category) AND $id_product->category != 'home') $link .= $id_product->category.'/'; else $link .= ''; //remove link id by Ha!*!*y //$link .= (int)$id_product->id.'-'; if (is_array($id_product->link_rewrite)) $link.= $id_product->link_rewrite[(int)$cookie->id_lang]; else $link.= $id_product->link_rewrite; if ($id_product->ean13) $link .='-'.$id_product->ean13; else $link .= ''; $link .= '.html'; } else { $link .= (_PS_BASE_URL_.__PS_BASE_URI__.'product.php?id_product='.(int)$id_product->id); } return $link; } else if ($alias) { $link = ''; if ($this->allow == 1) { $link .= (_PS_BASE_URL_.__PS_BASE_URI__.$this->getLangLink((int)$id_lang)); if ($category AND $category != 'home') $link .= $category.'/'; else $link .= ''; //remove link id by Ha!*!*y //$link .= (int)$id_product.'-'.$alias; $link .= $alias; if ($ean13) $link .='-'.$ean13; else $link .= ''; $link .= '.html'; } else $link .=(_PS_BASE_URL_.__PS_BASE_URI__.'product.php?id_product='.(int)$id_product); return $link; } else return _PS_BASE_URL_.__PS_BASE_URI__.'product.php?id_product='.(int)$id_product; } 3rd file: ./classes/Tools.php update the function generateHtaccess() find inside the function if ($multilang) { $tab['RewriteRule']['content']['^([a-z]{2})/[a-zA-Z0-9-]*/([0-9]+)\-[a-zA-Z0-9-]*\.html'] = 'product.php?id_product=$2&isolang=$1 [QSA,L]'; $tab['RewriteRule']['content']['^([a-z]{2})/([0-9]+)\-[a-zA-Z0-9-]*\.html'] = 'product.php?id_product=$2&isolang=$1 [QSA,L]'; and add the following lines: //remove link id by Ha!*!*y $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-f'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-d'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteRule ^([a-z]{2})/[a-zA-Z0-9-]*/([a-zA-Z0-9-]*)\.html product.php?product_name_seo=$2&isolang=$1 [QSA,L]'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-f'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-d'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteRule ^([a-z]{2})/([a-zA-Z0-9-]*)\.html product.php?product_name_seo=$2&isolang=$1 [QSA,L]'; //remove link id by Ha!*!*y also look for inside the function: $tab['RewriteRule']['content']['^([0-9]+)\-[a-zA-Z0-9-]*\.html'] = 'product.php?id_product=$1 [QSA,L]'; $tab['RewriteRule']['content']['^[a-zA-Z0-9-]*/([0-9]+)\-[a-zA-Z0-9-]*\.html'] = 'product.php?id_product=$1 [QSA,L]'; and than add the following lines: //remove link id by Ha!*!*y $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-f'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-d'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteRule ^([a-zA-Z0-9-]*)\.html product.php?product_name_seo=$1 [QSA,L]'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-f'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-d'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteRule ^[a-zA-Z0-9-]*/([a-zA-Z0-9-]*)\.html product.php?product_name_seo=$1 [QSA,L]'; //remove link id by Ha!*!*y also look for inside the function: // Classic URL rewriting if ($rewrite_settings) foreach ($tab['RewriteRule']['content'] as $rule => $url) fwrite($writeFd, 'RewriteRule '.$rule.' '.__PS_BASE_URI__.$url."\n"); add this after: //remove link id by Ha!*!*y if ($rewrite_settings){ fwrite($writeFd, "\n"); foreach ($tab['RewriteEngine']['content_no_id'] as $line => $rule){ fwrite($writeFd, $rule."\n"); } } //remove link id by Ha!*!*y Edited August 6, 2012 by HA!*!*Y (see edit history) 2 Link to comment Share on other sites More sharing options...
rysiu.h Posted May 11, 2012 Share Posted May 11, 2012 Hi HA!*!*Y This solution has side effects: All product metadata don't appearing and the title of page products show a default shop title. You can fix this?, apart from this problem everything works fine Thanks Rysiu Link to comment Share on other sites More sharing options...
Mr S Posted May 14, 2012 Share Posted May 14, 2012 (edited) FREE module available now: http://www.prestashop.com/forums/index.php?/topic/110922-friendly-urls-without-id-number/page__view__findpost__p__883380 i am look into it right now this is a temporary solutions to the problem Add this at the end of file: ./config/config.inc.php //remove link id by Ha!*!*y if (Tools::getValue('product_name_seo')) { $id_product = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' SELECT `id_product` FROM `'._DB_PREFIX_.'product_lang` WHERE `link_rewrite` = \''.Tools::getValue('product_name_seo').'\''); $_GET['id_product'] = $id_product; } Edited August 6, 2012 by HA!*!*Y (see edit history) 1 Link to comment Share on other sites More sharing options...
PC-SERVEIS Diseño Web Posted May 21, 2012 Share Posted May 21, 2012 Thank You very much for Sharing your PrestaShop code Greetings from Barcelona ! Link to comment Share on other sites More sharing options...
JessieMon Posted June 3, 2012 Share Posted June 3, 2012 Very helpful. Thanks! Link to comment Share on other sites More sharing options...
C.Perez Posted June 6, 2012 Share Posted June 6, 2012 Works partially on my 1.4.5... It does remove the ID from products, but not from my categories and neither CMS links.. Any idea why ?? however it did the most important thing... remove the ID from products.. Thanks. Link to comment Share on other sites More sharing options...
Will_Authentic_Style Posted June 14, 2012 Share Posted June 14, 2012 This also worked partially for me. It removes the ID's from product URL's, but it doesn't update all my URL's automatically, so all my links to products are broken. Do I need to do something to my htaccess file to do that? Link to comment Share on other sites More sharing options...
Mr S Posted June 15, 2012 Share Posted June 15, 2012 (edited) FREE module available now: http://www.prestashop.com/forums/index.php?/topic/110922-friendly-urls-without-id-number/page__view__findpost__p__883380 This also worked partially for me. It removes the ID's from product URL's, but it doesn't update all my URL's automatically, so all my links to products are broken. Do I need to do something to my htaccess file to do that? Yes Go to: Back Office > Tools > Generators Generate your ".htaccess" file by clicking the button Edited August 6, 2012 by HA!*!*Y (see edit history) Link to comment Share on other sites More sharing options...
Mr S Posted June 15, 2012 Share Posted June 15, 2012 (edited) FREE module available now: http://www.prestashop.com/forums/index.php?/topic/110922-friendly-urls-without-id-number/page__view__findpost__p__883380 Works partially on my 1.4.5... It does remove the ID from products, but not from my categories and neither CMS links.. Any idea why ?? however it did the most important thing... remove the ID from products.. Thanks. C.Perez, i did not update the code to remove IDs from categories or CMS link ill try to post that some time Edited August 6, 2012 by HA!*!*Y (see edit history) Link to comment Share on other sites More sharing options...
Will_Authentic_Style Posted June 15, 2012 Share Posted June 15, 2012 Yes Go to: Back Office > Tools > Generators Generate your ".htaccess" file by clicking the button Thanks for your reply HA!*!*Y. I did try regenerating my htaccess file from the back-office, but it didn't work. Could that be due to permissions on the file on the server? If I CHMOD the htaccess file to 777 will that work? Link to comment Share on other sites More sharing options...
emma_w Posted June 23, 2012 Share Posted June 23, 2012 (edited) Is there any progress in getting this to work for categories and subcategories? I had a bash at it myself, using your amends as a basis but unfortunately my dev skills don't seem up to the job as it didn't work! I edited the Link.php, Tools.php and config file but wasn't sure if anything needed changing in the ProductController, so perhaps that's where the issue lies... edit - Just realised it's the CategoryController file that needs editing, not ProductController of course. Unfortunately still not working so must be missing something? Edited June 23, 2012 by emma_w (see edit history) Link to comment Share on other sites More sharing options...
Mr S Posted July 1, 2012 Share Posted July 1, 2012 (edited) FREE module available now: http://www.prestashop.com/forums/index.php?/topic/110922-friendly-urls-without-id-number/page__view__findpost__p__883380 To remove number from Category URL 1st file: ./controllers/CategoryController.php update the function preProcess() public function preProcess() { if ($id_category = (int)Tools::getValue('id_category')) { $this->category = new Category($id_category, self::$cookie->id_lang); } else //remove link id by Ha!*!*y { $id_category = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' SELECT `link_rewrite` FROM `'._DB_PREFIX_.'category_lang` WHERE `link_rewrite` = \''.Tools::getValue('category_name_seo').'\''); $this->category = new Category($id_category, self::$cookie->id_lang); } //remove link id by Ha!*!*y .... 2nd file: ./classes/Link.php update the function getCategoryLink I removed (int)($id_category->id).'-'. from the functions in 2 places public function getCategoryLink($id_category, $alias = NULL, $id_lang = NULL) { if (is_object($id_category)) return ($this->allow == 1) ? (_PS_BASE_URL_.__PS_BASE_URI__.$this->getLangLink((int)($id_lang)).$id_category->link_rewrite) : (_PS_BASE_URL_.__PS_BASE_URI__.'category.php?id_category='.(int)($id_category->id)); if ($alias) return ($this->allow == 1) ? (_PS_BASE_URL_.__PS_BASE_URI__.$this->getLangLink((int)($id_lang)).$alias) : (_PS_BASE_URL_.__PS_BASE_URI__.'category.php?id_category='.(int)($id_category)); return _PS_BASE_URL_.__PS_BASE_URI__.'category.php?id_category='.(int)($id_category); } 3rd file: ./classes/Tools.php update the function generateHtaccess() find inside the function if ($multilang) { ..... .... $tab['RewriteRule']['content']['^([a-z]{2})/([0-9]+)\-[a-zA-Z0-9-]*(/[a-zA-Z0-9-]*)+'] = 'category.php?id_category=$2&isolang=$1&noredirect=1 [QSA,L]'; $tab['RewriteRule']['content']['^([a-z]{2})/([0-9]+)\-[a-zA-Z0-9-]*'] = 'category.php?id_category=$2&isolang=$1 [QSA,L]'; .... .... Add the following lines: //remove link id by Ha!*!*y $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-f'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-d'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteRule ^([a-z]{2})/([a-zA-Z0-9-])(/[a-zA-Z0-9-]*)+ category.php?category_name_seo=$2&isolang=$1&noredirect=1 [QSA,L]'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-f'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-d'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteRule ^([a-z]{2})/([a-zA-Z0-9-]*) category.php?category_name_seo=$2&isolang=$1&noredirect=1 [QSA,L]'; //remove link id by Ha!*!*y Find // Notice : the id_category rule has to be after product rules. // If not, category with number in their name will result a bug $tab['RewriteRule']['content']['^([0-9]+)\-[a-zA-Z0-9-]*(/[a-zA-Z0-9-]*)+'] = 'category.php?id_category=$1&noredirect=1 [QSA,L]'; $tab['RewriteRule']['content']['^([0-9]+)\-[a-zA-Z0-9-]*'] = 'category.php?id_category=$1 [QSA,L]'; Add the following lines: //remove link id by Ha!*!*y $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-f'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-d'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteRule ^([a-zA-Z0-9-]*)(/[a-zA-Z0-9-]*) category.php?category_name_seo=$1&noredirect=1 [QSA,L]'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-f'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-d'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteRule ^([a-zA-Z0-9-]*) category.php?category_name_seo=$1 [QSA,L]'; //remove link id by Ha!*!*y Add this at the end of file: ./config/config.inc.php //remove link id by Ha!*!*y if (Tools::getValue('product_name_seo')) { $id_product = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' SELECT `id_product` FROM `'._DB_PREFIX_.'product_lang` WHERE `link_rewrite` = \''.Tools::getValue('product_name_seo').'\''); $_GET['id_product'] = $id_product; } Than Go to: Back Office > Tools > Generators Generate your ".htaccess" file by clicking the button Edited August 6, 2012 by HA!*!*Y (see edit history) 1 Link to comment Share on other sites More sharing options...
emma_w Posted July 3, 2012 Share Posted July 3, 2012 Brilliant, thanks for this. I will try this out as soon as I get the chance. I'm interested to see what bit of code I got wrong when trying it myself (probably the htaccess file - I must admit I don't quite understand all the rewrite code). Link to comment Share on other sites More sharing options...
corint1 Posted July 3, 2012 Share Posted July 3, 2012 Don't work category in 1462 or 1482 ... what is wrong ? ( 01. Missing category ID ) Link to comment Share on other sites More sharing options...
ODM Posted July 3, 2012 Share Posted July 3, 2012 if you find that there is an error with the category id There is 1 error : Missing category ID you will have to do the fallowing Change in /classes/Tools.php (just remove the "+" sign before the filename) FROM //remove link id by Ha!*!*y $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-f'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-d'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteRule ^([a-zA-Z0-9-]*)(/[a-zA-Z0-9-]*)+ category.php?category_name_seo=$1&noredirect=1 [QSA,L]'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-f'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-d'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteRule ^([a-zA-Z0-9-]*)+ category.php?category_name_seo=$1 [QSA,L]'; //remove link id by Ha!*!*y TO //remove link id by Ha!*!*y $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-f'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-d'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteRule ^([a-zA-Z0-9-]*)(/[a-zA-Z0-9-]*) category.php?category_name_seo=$1&noredirect=1 [QSA,L]'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-f'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-d'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteRule ^([a-zA-Z0-9-]*) category.php?category_name_seo=$1 [QSA,L]'; //remove link id by Ha!*!*y Add at the end of /config/config.inc.php if (Tools::getValue('category_name_seo')) { $id_category = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' SELECT `id_category` FROM `'._DB_PREFIX_.'category_lang` WHERE `link_rewrite` = \''.Tools::getValue('category_name_seo').'\''); $_GET['id_category'] = $id_category; } and regenerate you htaccess 2 Link to comment Share on other sites More sharing options...
corint1 Posted July 4, 2012 Share Posted July 4, 2012 working...... tks Link to comment Share on other sites More sharing options...
giuly Posted July 6, 2012 Share Posted July 6, 2012 please I have 1.4.8.2 I tried to modify that file, but I do wrong some code, if I use file modified by me it doesn't work (500 error), please could you give to me file right for that version of ps? Thanks Link to comment Share on other sites More sharing options...
emma_w Posted July 6, 2012 Share Posted July 6, 2012 Have you modified ALL the files necessary? ./controllers/ProductController.php ./controllers/CategoryController.php ./classes/Link.php ./classes/Tools.php ./config/config.inc.php ..AND generated a new htaccess file through your admin? Link to comment Share on other sites More sharing options...
giuly Posted July 6, 2012 Share Posted July 6, 2012 sorry i write in wrong topic, my mistake, I would write on ean13 topic, sorry... Link to comment Share on other sites More sharing options...
matyz Posted July 8, 2012 Share Posted July 8, 2012 (edited) [edit] Works great on presta 1.4.5.1 Thanks for this solution!!! Edited July 9, 2012 by matyz (see edit history) Link to comment Share on other sites More sharing options...
corint1 Posted July 8, 2012 Share Posted July 8, 2012 (edited) all work excelent , but sitemap isn't ok ... i have some like " /content/ name of category" ... webmaster found as broken link or page not found, but link working ... what happening ? use diferent sitemap generator ... result is same Edited July 8, 2012 by corint1 (see edit history) Link to comment Share on other sites More sharing options...
tranfy Posted July 10, 2012 Share Posted July 10, 2012 (edited) Hi, in 1.4.7, I did as above steps but there is an error when clicking on the product item. There is 1 error : Product not found What's wrong with that? It works now! for my mistake~ Thank you for your hard work! Edited July 11, 2012 by tranfy (see edit history) Link to comment Share on other sites More sharing options...
antonpas_bcn Posted July 12, 2012 Share Posted July 12, 2012 Hello, I am writing you because I had changed the URL of the items will be displayed without the category. Ex. www.web.com/5-category/124-product.html to www.web.com/124-product.html This I have taken from this post: http://www.prestashop.com/forums/topic/30419-remove-category-from-product-url/ When I apply the changes that you have indicated the URL shown without ID but instead the categories reappear in the URL. I would like this: www.web.com/product.html Someone could help me fix this? Thanks! Link to comment Share on other sites More sharing options...
Mr S Posted July 13, 2012 Share Posted July 13, 2012 (edited) FREE module available now: http://www.prestashop.com/forums/index.php?/topic/110922-friendly-urls-without-id-number/page__view__findpost__p__883380 Hello, I am writing you because I had changed the URL of the items will be displayed without the category. Ex. www.web.com/5-category/124-product.html to www.web.com/124-product.html This I have taken from this post: http://www.prestasho...om-product-url/ When I apply the changes that you have indicated the URL shown without ID but instead the categories reappear in the URL. I would like this: www.web.com/product.html Someone could help me fix this? Thanks! antonpas_bcn if all you want to do is remove the category name from URL its really easy go to file ./classes/Link.php and find public function getProductLink and edit out the line from if (isset($id_product->category) AND !empty($id_product->category) AND $id_product->category != 'home') $link .= $id_product->category.'/'; TO if (isset($id_product->category) AND !empty($id_product->category) AND $id_product->category != 'home') $link .= ''; AND ALSO $link .= (_PS_BASE_URL_.__PS_BASE_URI__.$this->getLangLink((int)$id_lang)); if ($category AND $category != 'home') $link .= $category.'/'; TO $link .= (_PS_BASE_URL_.__PS_BASE_URI__.$this->getLangLink((int)$id_lang)); if ($category AND $category != 'home') $link .= ''; Edited August 6, 2012 by HA!*!*Y (see edit history) Link to comment Share on other sites More sharing options...
antonpas_bcn Posted July 13, 2012 Share Posted July 13, 2012 (edited) Hi, thanks for your help. When I try to access in a category the URL looks good, but I get the error 500. Thanks! Edited July 13, 2012 by antonpas_bcn (see edit history) Link to comment Share on other sites More sharing options...
Kerym Posted July 13, 2012 Share Posted July 13, 2012 Thank you for this solution. I want to ask what kind of side effects can be occur by doing these changes. İnitially I think about: 1-Duplicate url - Canonical url problems 2-Speed and performance problems 3-Core function or module problem What kind of undesirable effects can be come out when we do this changes? Or isn't there any problem or negative effects? 1 Link to comment Share on other sites More sharing options...
Mr S Posted July 15, 2012 Share Posted July 15, 2012 Kerym there are some negative effects from it 1. Duplicate urls if you create two Products with the same seo url than prestashop will redirect you the the 1st of the 2 urls 2. if you keep the ID in the URL than you could change the SEO URL and the old URLS will 301 redirect to the new address ----- old url: www.web.com/category/124-product.html ----- new url: www.web.com/category/124-new-seo-url.html 3. As long as the modules use the getProductLink() function for the URLs there should not be any issues from it. 4. And far as performances go i don't see any slow down 1 Link to comment Share on other sites More sharing options...
Raitis Posted July 16, 2012 Share Posted July 16, 2012 To remove number from Category URL 1st file: ./controllers/CategoryController.php update the function preProcess() public function preProcess() { if ($id_category = (int)Tools::getValue('id_category')) { $this->category = new Category($id_category, self::$cookie->id_lang); } else //remove link id by Ha!*!*y { $id_category = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' SELECT `link_rewrite` FROM `'._DB_PREFIX_.'category_lang` WHERE `link_rewrite` = \''.Tools::getValue('category_name_seo').'\''); $this->category = new Category($id_category, self::$cookie->id_lang); } //remove link id by Ha!*!*y .... 2nd file: ./classes/Link.php update the function getCategoryLink I removed (int)($id_category->id).'-'. from the functions in 2 places public function getCategoryLink($id_category, $alias = NULL, $id_lang = NULL) { if (is_object($id_category)) return ($this->allow == 1) ? (_PS_BASE_URL_.__PS_BASE_URI__.$this->getLangLink((int)($id_lang)).$id_category->link_rewrite) : (_PS_BASE_URL_.__PS_BASE_URI__.'category.php?id_category='.(int)($id_category->id)); if ($alias) return ($this->allow == 1) ? (_PS_BASE_URL_.__PS_BASE_URI__.$this->getLangLink((int)($id_lang)).$alias) : (_PS_BASE_URL_.__PS_BASE_URI__.'category.php?id_category='.(int)($id_category)); return _PS_BASE_URL_.__PS_BASE_URI__.'category.php?id_category='.(int)($id_category); } 3rd file: ./classes/Tools.php update the function generateHtaccess() find inside the function if ($multilang) { ..... .... $tab['RewriteRule']['content']['^([a-z]{2})/([0-9]+)\-[a-zA-Z0-9-]*(/[a-zA-Z0-9-]*)+'] = 'category.php?id_category=$2&isolang=$1&noredirect=1 [QSA,L]'; $tab['RewriteRule']['content']['^([a-z]{2})/([0-9]+)\-[a-zA-Z0-9-]*'] = 'category.php?id_category=$2&isolang=$1 [QSA,L]'; .... .... Add the following lines: //remove link id by Ha!*!*y $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-f'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-d'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteRule ^([a-z]{2})/([a-zA-Z0-9-])(/[a-zA-Z0-9-]*)+ category.php?category_name_seo=$2&isolang=$1&noredirect=1 [QSA,L]'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-f'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-d'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteRule ^([a-z]{2})/([a-zA-Z0-9-]*) category.php?category_name_seo=$2&isolang=$1&noredirect=1 [QSA,L]'; //remove link id by Ha!*!*y Find // Notice : the id_category rule has to be after product rules. // If not, category with number in their name will result a bug $tab['RewriteRule']['content']['^([0-9]+)\-[a-zA-Z0-9-]*(/[a-zA-Z0-9-]*)+'] = 'category.php?id_category=$1&noredirect=1 [QSA,L]'; $tab['RewriteRule']['content']['^([0-9]+)\-[a-zA-Z0-9-]*'] = 'category.php?id_category=$1 [QSA,L]'; Add the following lines: //remove link id by Ha!*!*y $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-f'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-d'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteRule ^([a-zA-Z0-9-]*)(/[a-zA-Z0-9-]*) category.php?category_name_seo=$1&noredirect=1 [QSA,L]'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-f'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-d'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteRule ^([a-zA-Z0-9-]*) category.php?category_name_seo=$1 [QSA,L]'; //remove link id by Ha!*!*y Add this at the end of file: ./config/config.inc.php //remove link id by Ha!*!*y if (Tools::getValue('product_name_seo')) { $id_product = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' SELECT `id_product` FROM `'._DB_PREFIX_.'product_lang` WHERE `link_rewrite` = \''.Tools::getValue('product_name_seo').'\''); $_GET['id_product'] = $id_product; } Than Go to: Back Office > Tools > Generators Generate your ".htaccess" file by clicking the button Hi! HA!*!*Y I am stuck with Your tutorial an I get only blank page I have prestashop 1.4.8.2 Best Regards Raitis Link to comment Share on other sites More sharing options...
Kerym Posted July 17, 2012 Share Posted July 17, 2012 Thank you for detailed answers HA!*!*Y you are great. Prestashoponline what is the difference of your module? What kind of benefits does your module have more than HA!*!*Y's solution on deleting id from urls? Thanks Link to comment Share on other sites More sharing options...
corint1 Posted July 17, 2012 Share Posted July 17, 2012 (edited) prestashoponline's module is for money ... this is the diference... Edited July 17, 2012 by corint1 (see edit history) Link to comment Share on other sites More sharing options...
Mike Kranzler Posted July 17, 2012 Share Posted July 17, 2012 prestashoponline's module is for money ... this is the diference... This module has also been reported for potentially being stolen content. Please do not purchase it until this has been resolved. Thank you for detailed answers HA!*!*Y you are great. Prestashoponline what is the difference of your module? What kind of benefits does your module have more than HA!*!*Y's solution on deleting id from urls? Thanks Please do not purchase this module. It has been reported as potential stolen content. We are investigating. Link to comment Share on other sites More sharing options...
Mr S Posted July 20, 2012 Share Posted July 20, 2012 (edited) I am moving to a new post for updates see URL: http://www.prestasho...hout-id-number/ No more file editing i have a free module did not fix the cms links as of now plz note its a bata need to be tested change log (removeURLid_v0.1b.2.zip) - fixed name typo (capital class name) that caused problem with installing change log (removeURLid_v0.1b.1.zip) -fixed the CategoryController file path by corint1 -module now edits the config file change log (removeURLid_v0.1b.1.zip) - 1st release removeURLid_v0.1b.zip removeURLid_v0.1b.1.zip removeURLid_v0.1b.2.zip Edited September 21, 2012 by HA!*!*Y (see edit history) 4 Link to comment Share on other sites More sharing options...
Raitis Posted July 20, 2012 Share Posted July 20, 2012 No more file editing i have a free module did not fix the cms links as of now plz note its a bata need to be tested for me not working .... There is 1 error : Product not found Link to comment Share on other sites More sharing options...
corint1 Posted July 20, 2012 Share Posted July 20, 2012 (edited) working perfect...but must modify lines : 'CategoryController' => _PS_ROOT_DIR_ . $slash . '/override/classes/Tools.php', to 'CategoryController' => _PS_ROOT_DIR_ . $slash . '/override/classes/CategoryController.php', in all 3 places ... tks ... read all specification or search in files for explication .... //Edit the conf file?? //config.inc.php isn't possible to append ? or create o new file and copy like other files ... problem is with install ... if need cu override other procedures in this files , when installing this module lost all modification (copy new files, not append modifications)...same problem is on uninstall...backup not working ... append is a solution ... is possible ? same problem in on uninstall... Edited July 20, 2012 by corint1 (see edit history) Link to comment Share on other sites More sharing options...
Mr S Posted July 21, 2012 Share Posted July 21, 2012 module updated: http://www.prestashop.com/forums/index.php?/topic/110922-friendly-urls-without-id-number/page__view__findpost__p__883380 1 Link to comment Share on other sites More sharing options...
corint1 Posted July 21, 2012 Share Posted July 21, 2012 isn't ok ...fopen and fclose isn't allowed by most hosting provider ... they recommend to use curl function ... with install or uninstall problem is same lost any previously modification... tks Link to comment Share on other sites More sharing options...
newimage Posted August 6, 2012 Share Posted August 6, 2012 Is there a way to accomplish this for the manufacturer links. Right now it's showing 1_bose instead of just bose. Link to comment Share on other sites More sharing options...
cassim Posted August 9, 2012 Share Posted August 9, 2012 any way to make this work ? Link to comment Share on other sites More sharing options...
ODM Posted August 10, 2012 Share Posted August 10, 2012 (edited) How to remove ID from CMS Page 1./ Open /controllers/CMSController.php Find: if ($id_cms = (int)Tools::getValue('id_cms')) Replace With: if ($id_cms = (int)Tools::getValue('id_cms') and $id_cms != 0) 2./ Open /classes/Link.php Find: public function getCMSCategoryLink Replace function with: public function getCMSCategoryLink($id_category, $alias = NULL, $id_lang = NULL) { if (is_object($id_category)) return ($this->allow == 1) ? (_PS_BASE_URL_.__PS_BASE_URI__.$this->getLangLink((int)($id_lang)).'content/category/'.$id_category->link_rewrite) : (_PS_BASE_URL_.__PS_BASE_URI__.'cms.php?id_cms_category='.(int)($id_category->id)); if ($alias) return ($this->allow == 1) ? (_PS_BASE_URL_.__PS_BASE_URI__.$this->getLangLink((int)($id_lang)).'content/category/'.$alias) : (_PS_BASE_URL_.__PS_BASE_URI__.'cms.php?id_cms_category='.(int)($id_category)); return _PS_BASE_URL_.__PS_BASE_URI__.'cms.php?id_cms_category='.(int)($id_category); } Find: public function getCMSLink Replace with: 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)).'content/'.$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)).'content/'.$alias) : ($base.__PS_BASE_URI__.'cms.php?id_cms='.(int)($cms)); return $base.__PS_BASE_URI__.'cms.php?id_cms='.(int)($cms); } 3./ Open /classes/Tools.php Search for public static function generateHtaccess( Find inside this function: if ($multilang) { Add inside this clause (if you used Ha!*!*y method for categories the add above this conditions the fallowing lines) $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-f'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-d'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteRule ^([a-z]{2})/content/category/([a-zA-Z0-9-]*) cms.php?cms_category_name_seo=$1&noredirect=1 [QSA,L]'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-f'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-d'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteRule ^([a-z]{2})/content/([a-zA-Z0-9-]*) cms.php?cms_name_seo=$1 [QSA,L]'; After the if clause and above(if you used Ha!*!*y method for categories the add above this conditions the fallowing lines) add $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-f'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-d'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteRule ^content/category/([a-zA-Z0-9-]*) cms.php?cms_category_name_seo=$1&noredirect=1 [QSA,L]'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-f'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-d'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteRule ^content/([a-zA-Z0-9-]*) cms.php?cms_name_seo=$1 [QSA,L]'; 4./ Open /config/config.inc.php append at the end of the file the fallowing // Cms Category if (Tools::getValue('cms_category_name_seo')) { $id_category = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' SELECT `id_cms_category` FROM `'._DB_PREFIX_.'cms_category_lang` WHERE `link_rewrite` = \''.Tools::getValue('cms_category_name_seo').'\''); $_GET['id_cms_category'] = $id_category; } // Cms Page if (Tools::getValue('cms_name_seo')) { $id_cms = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' SELECT `id_cms` FROM `'._DB_PREFIX_.'cms_lang` WHERE `link_rewrite` = \''.Tools::getValue('cms_name_seo').'\''); $_GET['id_cms'] = $id_cms; } REGENERATE YOU HTACCESS I don't have enoght patience to explain this more clear, thus I ask the users reading this forum to make a more detailed explication. Ha!*!*y - Please implement this functionality in your module and make it public to the word! Live Free - Live Strong Edited August 10, 2012 by ODM (see edit history) 2 Link to comment Share on other sites More sharing options...
benjamin utterback Posted August 10, 2012 Share Posted August 10, 2012 ODM, do you know if the same function can be used to take the number ID out of the manufacture as newimage has asked? Thank you for the great input Is there a way to accomplish this for the manufacturer links. Right now it's showing 1_bose instead of just bose. ? Link to comment Share on other sites More sharing options...
ODM Posted August 13, 2012 Share Posted August 13, 2012 The same principle that Ha!*!*y started applies for ALL URL's. The only remaining ones are for Manufacturers and Vendors. I have applied it for CMS pages (because this was asked by a client for one of my projects) If in the future projects I will require to remove the ID for manufacturers and/or vendors I will do it and post it here PS1 It toked me 5 minutes to remove the ID .... All the files where the url functions are located are listed above, and it's pretty simple even for a "PrestaShop Apprentice" PS2 I hope that Prestashop Dev Team has in mind the removal of IDs from all urls in the final version of 1.5 Link to comment Share on other sites More sharing options...
benjamin utterback Posted August 13, 2012 Share Posted August 13, 2012 Hello ODM, thanks for the message. I will transfer your message to the development team to take your advice into consideration. Thanks for choosing PrestaShop! Link to comment Share on other sites More sharing options...
wizeazz Posted August 17, 2012 Share Posted August 17, 2012 HA!*!*Y works perfect! words are not enough to describe simple and profound thank you! kudos 2U! same 4 ODM. Link to comment Share on other sites More sharing options...
duxyz Posted August 26, 2012 Share Posted August 26, 2012 I can't uninstall it successfully. There is an error message. Can somebody explain how to remove it, please? Link to comment Share on other sites More sharing options...
benjamin utterback Posted August 28, 2012 Share Posted August 28, 2012 Hello duxyz, Welcome to the PrestaShop Forums! We are very glad to have you with us. If you do not mind, please specify which error you receive. Also, if you could please post screenshots, this will help us too. Thank you so much for using PrestaShop. Link to comment Share on other sites More sharing options...
duxyz Posted August 28, 2012 Share Posted August 28, 2012 Hello duxyz, Welcome to the PrestaShop Forums! We are very glad to have you with us. If you do not mind, please specify which error you receive. Also, if you could please post screenshots, this will help us too. Thank you so much for using PrestaShop. Hi, Benjamin. Thank you for being so kind! When I clicked on uninstall i got red error message that it can't be installed successfully. I know, it said "installed", not "uninstalled". After that it was showing in modules that it really is not installed, but some of the links on the page were still "friendly" and pages were acting strange. I checked .htaccess and the "friendly" code really was removed. I don't understand the problem. I decided than to try install it again, because it was working OK while installed. My site works perfectly now. I just wanted to remove it because some of my old links were already indexed in Google before installing this module, but never mind, Google will index new ones soon. I am just hoping that this cool module will work on new versions of Prestashop, so I don't loose newly indexed friendly links! (they are really so cool without those unnecessary numbers! ) p.s. I hope you understood me, because my English sucks! Link to comment Share on other sites More sharing options...
benjamin utterback Posted August 28, 2012 Share Posted August 28, 2012 Hello duxyz, Thank you for the message. If I am understanding correctly, you have successfully solved your problem and your website is working? Link to comment Share on other sites More sharing options...
duxyz Posted August 28, 2012 Share Posted August 28, 2012 Yes, website is working fine, just this module(Friendly URLs without ID Number v0.1 by HA!*!*Y) can't be uninstalled correctly on my Prestashop 1.4.8.3. So I am having a website with installed module. 1 Link to comment Share on other sites More sharing options...
benjamin utterback Posted August 28, 2012 Share Posted August 28, 2012 Hello and thank you for the confirmation duxyz, I will go ahead and mark this thread as solved. Thank you all for using PrestaShop! Happy selling! Link to comment Share on other sites More sharing options...
benknackan Posted September 13, 2012 Share Posted September 13, 2012 (edited) Hi all, great module! Works great. However I got two questions regarding this. First off I think I broke something when I installed this as date and time won't show in carts and orders, see pictures. The date and time is visible when u click a specific cart or order though. Also a lot of information seems to be missing in the order details. Any idea how to fix this? Also in the theme of the thread. An1 could tell me how to remove the .html for all product pages. So it just says productname...? Edited September 13, 2012 by benknackan (see edit history) Link to comment Share on other sites More sharing options...
Numpaque Posted September 14, 2012 Share Posted September 14, 2012 No more file editing i have a free module did not fix the cms links as of now plz note its a bata need to be tested change log (removeURLid_v0.1b.2.zip) - fixed name typo (capital class name) that caused problem with installing change log (removeURLid_v0.1b.1.zip) -fixed the CategoryController file path by corint1 -module now edits the config file change log (removeURLid_v0.1b.1.zip) - 1st release hi, actually I'm installed in my shop and works well, now I want to upgrade my shop to PS 1.5 can you tellme if it works on PS1.5thankyou! Link to comment Share on other sites More sharing options...
spiffyd Posted September 16, 2012 Share Posted September 16, 2012 I installed HA!*!*Y module removeURLid_v0.1b.2.zip which works flawlessly for products and categories. I also followed ODM's instructions on "How to Remove ID from CMS Page" but still couldn't get CMS pages to work without IDs. The IDs still show on CMS menu links. When manually removing the IDs in the URL, I get the following error: There is 1 error : Missing category ID Am I missing something here? Link to comment Share on other sites More sharing options...
Gaddy Posted September 20, 2012 Share Posted September 20, 2012 I am facing the same problem. Did i go wrong in copying the code? Link to comment Share on other sites More sharing options...
baste78 Posted September 21, 2012 Share Posted September 21, 2012 (edited) Looks like my problem was with another module. Sorry and thanks all. Edited September 21, 2012 by loraleku.com (see edit history) Link to comment Share on other sites More sharing options...
baste78 Posted September 21, 2012 Share Posted September 21, 2012 (edited) Looks like my problem was with another module. Sorry and thanks all. Edited September 21, 2012 by loraleku.com (see edit history) Link to comment Share on other sites More sharing options...
spiffyd Posted September 21, 2012 Share Posted September 21, 2012 I think those instructions by OEM to remove ID# from CMS pages may have some problems because a few of us have problems getting it to work. In the meantime, if you just want no ID # for products, just install the HA!*!*Y module removeURLid_v0.1b.2.zip and that should work with no problems. Hi guys, this is a Prestashop newbie on his first message. I tried to follow the steps, but now I'm getting a blank product description page in every product detail. Since my knowledge as developer is very basic, I wouldn't mind of going back to the beginning and forget about deleting category and product ID's. But I don't know how. - I tried to restore previous backups, when I didn't have this problem, but the problem doesn't solve. - I also tried restoring the original files from prestashop 1.4.9 that I modified following the steps of this post (productcontroller.php, categorycontroller.php, link.php, tools.php and config.inc.php) but the page keeps being in blank. Please let me know any solution in order to fix this problem. Thank you all so much. Ivon Ps. I would give you additional information of the site if asked. Attaching a couple of escreenshots. Link to comment Share on other sites More sharing options...
Mr S Posted September 21, 2012 Share Posted September 21, 2012 I moving to a new post @ http://www.prestashop.com/forums/topic/189443-override-friendly-urls-without-id-number/ Link to comment Share on other sites More sharing options...
baste78 Posted September 21, 2012 Share Posted September 21, 2012 (edited) I think those instructions by OEM to remove ID# from CMS pages may have some problems because a few of us have problems getting it to work. In the meantime, if you just want no ID # for products, just install the HA!*!*Y module removeURLid_v0.1b.2.zip and that should work with no problems. Looks like my problem was with another module. Sorry and thanks all. Edited September 21, 2012 by loraleku.com (see edit history) Link to comment Share on other sites More sharing options...
spiffyd Posted September 21, 2012 Share Posted September 21, 2012 Try this, a new updated module just went up! http://www.prestashop.com/forums/topic/189443-override-friendly-urls-without-id-number/ Link to comment Share on other sites More sharing options...
baste78 Posted September 21, 2012 Share Posted September 21, 2012 (edited) Looks like my problem was with another module. Sorry and thanks all. Edited September 21, 2012 by loraleku.com (see edit history) Link to comment Share on other sites More sharing options...
henryk20 Posted October 22, 2012 Share Posted October 22, 2012 (edited) Hello, i have problem with friendly urls in category. I have PS 1.4.4.1 I made exactly the same as below: FREE module available now: http://www.prestasho...post__p__883380 To remove number from Category URL 1st file: ./controllers/CategoryController.php update the function preProcess() public function preProcess() { if ($id_category = (int)Tools::getValue('id_category')) { $this->category = new Category($id_category, self::$cookie->id_lang); } else //remove link id by Ha!*!*y { $id_category = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' SELECT `link_rewrite` FROM `'._DB_PREFIX_.'category_lang` WHERE `link_rewrite` = \''.Tools::getValue('category_name_seo').'\''); $this->category = new Category($id_category, self::$cookie->id_lang); } //remove link id by Ha!*!*y .... 2nd file: ./classes/Link.php update the function getCategoryLink I removed (int)($id_category->id).'-'. from the functions in 2 places public function getCategoryLink($id_category, $alias = NULL, $id_lang = NULL) { if (is_object($id_category)) return ($this->allow == 1) ? (_PS_BASE_URL_.__PS_BASE_URI__.$this->getLangLink((int)($id_lang)).$id_category->link_rewrite) : (_PS_BASE_URL_.__PS_BASE_URI__.'category.php?id_category='.(int)($id_category->id)); if ($alias) return ($this->allow == 1) ? (_PS_BASE_URL_.__PS_BASE_URI__.$this->getLangLink((int)($id_lang)).$alias) : (_PS_BASE_URL_.__PS_BASE_URI__.'category.php?id_category='.(int)($id_category)); return _PS_BASE_URL_.__PS_BASE_URI__.'category.php?id_category='.(int)($id_category); } 3rd file: ./classes/Tools.php update the function generateHtaccess() find inside the function if ($multilang) { ..... .... $tab['RewriteRule']['content']['^([a-z]{2})/([0-9]+)\-[a-zA-Z0-9-]*(/[a-zA-Z0-9-]*)+'] = 'category.php?id_category=$2&isolang=$1&noredirect=1 [QSA,L]'; $tab['RewriteRule']['content']['^([a-z]{2})/([0-9]+)\-[a-zA-Z0-9-]*'] = 'category.php?id_category=$2&isolang=$1 [QSA,L]'; .... .... Add the following lines: //remove link id by Ha!*!*y $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-f'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-d'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteRule ^([a-z]{2})/([a-zA-Z0-9-])(/[a-zA-Z0-9-]*)+ category.php?category_name_seo=$2&isolang=$1&noredirect=1 [QSA,L]'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-f'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-d'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteRule ^([a-z]{2})/([a-zA-Z0-9-]*) category.php?category_name_seo=$2&isolang=$1&noredirect=1 [QSA,L]'; //remove link id by Ha!*!*y Find // Notice : the id_category rule has to be after product rules. // If not, category with number in their name will result a bug $tab['RewriteRule']['content']['^([0-9]+)\-[a-zA-Z0-9-]*(/[a-zA-Z0-9-]*)+'] = 'category.php?id_category=$1&noredirect=1 [QSA,L]'; $tab['RewriteRule']['content']['^([0-9]+)\-[a-zA-Z0-9-]*'] = 'category.php?id_category=$1 [QSA,L]'; Add the following lines: //remove link id by Ha!*!*y $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-f'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-d'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteRule ^([a-zA-Z0-9-]*)(/[a-zA-Z0-9-]*) category.php?category_name_seo=$1&noredirect=1 [QSA,L]'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-f'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteCond %{REQUEST_FILENAME} !-d'; $tab['RewriteEngine']['content_no_id'][] = 'RewriteRule ^([a-zA-Z0-9-]*) category.php?category_name_seo=$1 [QSA,L]'; //remove link id by Ha!*!*y Add this at the end of file: ./config/config.inc.php //remove link id by Ha!*!*y if (Tools::getValue('product_name_seo')) { $id_product = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' SELECT `id_product` FROM `'._DB_PREFIX_.'product_lang` WHERE `link_rewrite` = \''.Tools::getValue('product_name_seo').'\''); $_GET['id_product'] = $id_product; } Than Go to: Back Office > Tools > Generators Generate your ".htaccess" file by clicking the button .. and does not work. I have category url: /8-uslugi When i do: /uslugi I've done everything as above and i see: page not found When I did the friendly url for products it all works. PLEASE HELP! _____________________________ Agencja Reklamowa JUSTPRO Edited October 31, 2012 by henryk20 (see edit history) Link to comment Share on other sites More sharing options...
wizeazz Posted October 22, 2012 Share Posted October 22, 2012 Hello, regenerate htaccess file Link to comment Share on other sites More sharing options...
benjamin utterback Posted October 22, 2012 Share Posted October 22, 2012 Hello henryk20, have you tried wizeazz's suggestion to regenerate the HTaccess file. Let us know if this solved your problem. Also always make sure you complete a back up before changed any files! Link to comment Share on other sites More sharing options...
henryk20 Posted October 22, 2012 Share Posted October 22, 2012 (edited) regenerate the htaccess file dosnt work ----------------- I did anything other and it works properly But, I have another question. How to remove .html from product url? _____________________________ Agencja Reklamowa JUSTPRO Edited October 31, 2012 by henryk20 (see edit history) Link to comment Share on other sites More sharing options...
wizeazz Posted October 23, 2012 Share Posted October 23, 2012 But, I have another question. How to remove .html from product url? I,ve tried to do this, but than I realized that this is zero sum game. why? because, if you are willing to spend from one to seven days for saving max 150$(this is the most expensive seo module) go ahead, if not, my suggestion is, buy seo module for presta. that is what I have done. seo modules you can get from 40$-150$. this is my opinion. you do as you think is best for you. Link to comment Share on other sites More sharing options...
henryk20 Posted October 23, 2012 Share Posted October 23, 2012 (edited) I,ve tried to do this, but than I realized that this is zero sum game. why? because, if you are willing to spend from one to seven days for saving max 150$(this is the most expensive seo module) go ahead, if not, my suggestion is, buy seo module for presta. that is what I have done. seo modules you can get from 40$-150$. this is my opinion. you do as you think is best for you. Thanks for Your answer. Now for me the best solution is to remove .html from url. Anyone did this? _____________________________ Agencja Reklamowa JUSTPRO Edited October 31, 2012 by henryk20 (see edit history) Link to comment Share on other sites More sharing options...
henryk20 Posted October 23, 2012 Share Posted October 23, 2012 (edited) Anyone can help me? _____________________________ Agencja Reklamowa JUSTPRO Edited October 31, 2012 by henryk20 (see edit history) Link to comment Share on other sites More sharing options...
kashifkhan112 Posted December 27, 2012 Share Posted December 27, 2012 is it work with 1.5.2 version? Link to comment Share on other sites More sharing options...
robbie007 Posted December 27, 2012 Share Posted December 27, 2012 (edited) Anyone an idea how to use capital letters in URL's in Presta's latest version 1.5.2? If I add or change a product via catalog > products > edit > seo the capital letters are directly changed into lowercase in the field friendly URL, so can't put it in. Very frustrating because I don't want to make handmade redirects for my old indexed URL's wich look like /Products-Tennis.html for example. Now I can only make /products-tennis.html. Wich piece of script can I change? When I make a category in Presta then it does allow capital letters. So it has to be possible. Thanks in advance! Edited December 27, 2012 by robbie007 (see edit history) Link to comment Share on other sites More sharing options...
kashifkhan112 Posted December 28, 2012 Share Posted December 28, 2012 Can you please provide coding for Prestashop 1.5.2 version Link to comment Share on other sites More sharing options...
robbie007 Posted December 28, 2012 Share Posted December 28, 2012 Hi Kashifkhan112, Code is no problem, but don't know in wich file I have to look. Anyone? Link to comment Share on other sites More sharing options...
BrianW Posted February 6, 2013 Share Posted February 6, 2013 Can somebody help me out, I tried this module and it removed the ID`s....but as i`m on a zeus server I cannot generate the .htaccess file. Now I am getting broken links even after removing the module and replacing my classes, controller, config and tools files. I cant find any info on the zeus equivalent to the .htaccess script that would make this work so is there any way to revert back to including the ID in the URL? I`m not sure exactly what files this module has overridden but i`ve tried a fresh install of my site from a backup and it`s had no affect?!!! Link to comment Share on other sites More sharing options...
robbie007 Posted February 6, 2013 Share Posted February 6, 2013 Did you had your Friendly URL + canonical URL turned to on when testing the Pretty URL module? Link to comment Share on other sites More sharing options...
BrianW Posted February 6, 2013 Share Posted February 6, 2013 Did you had your Friendly URL + canonical URL turned to on when testing the Pretty URL module? Yes Link to comment Share on other sites More sharing options...
robbie007 Posted February 6, 2013 Share Posted February 6, 2013 Presta creates always an .htacces file. It's hidden, see display hidden files in your FTP. Link to comment Share on other sites More sharing options...
BrianW Posted February 6, 2013 Share Posted February 6, 2013 Presta creates always an .htacces file. It's hidden, see display hidden files in your FTP. My .htaccess is visible, but I dont think that will make any difference as I`m on a zeus server. The zeus server uses a .rewritescript and i`ve replaced it but it`s made no change? Does this module overwrite any information in the database? It`s strange because i`ve basically replaced my whole site from a backup and the links are still broken Link to comment Share on other sites More sharing options...
BrianW Posted February 6, 2013 Share Posted February 6, 2013 It could actually be a problem with my server....i`m with register365 (that should explain a lot of the problems i`ve been having) Link to comment Share on other sites More sharing options...
robbie007 Posted February 6, 2013 Share Posted February 6, 2013 Sorry, I'm not a pro. I should turn settings off/on and reinstall module. Link to comment Share on other sites More sharing options...
BrianW Posted February 6, 2013 Share Posted February 6, 2013 The issue was indeed with my server. Just for the record if anybody is ever thinking about joining register365 give yourself a good slap and find a good hosting service. What a disaster, i`ve had nothing but problems with them. The speed of their server varies between 6 to 60 seconds to load your site, 500 internal server errors...and the list goes on and on....I`m glad to say i`ve notified them I will not be renewing my contract....(probably not the right place for a rant I know but they`re a joke) Link to comment Share on other sites More sharing options...
benjamin utterback Posted February 6, 2013 Share Posted February 6, 2013 Hi BrianW, that is okay. Actually, it's good that you mentioned that your problems came from your hosting. A badly configured hosting set up can cause a nightmare, as you've so aptly stated. Which hosting providers are you looking into? Check out our hosting partners here! http://www.prestashop.com/en/industry-partners 1 Link to comment Share on other sites More sharing options...
BrianW Posted February 6, 2013 Share Posted February 6, 2013 Hi BrianW, that is okay. Actually, it's good that you mentioned that your problems came from your hosting. A badly configured hosting set up can cause a nightmare, as you've so aptly stated. Which hosting providers are you looking into? Check out our hosting partners here! http://www.prestasho...dustry-partners Hi Benjamin, Thanks for your reply. I have actually been in touch with A2 hosting. I was searching a few weeks ago for Prestashop recommended hosts and I came across them, and I seen you commented on them in another post which pointed me in the right direction. So all going well I should be making the switch soon, and i`ll be sure to use you link to do it Thanks for your help, Brian Link to comment Share on other sites More sharing options...
Dmit Posted February 8, 2013 Share Posted February 8, 2013 Work 1.5.3? Link to comment Share on other sites More sharing options...
Mr S Posted February 26, 2013 Share Posted February 26, 2013 @Dmit For 1.5xx see post http://www.prestashop.com/forums/topic/204935-override-friendly-urls-without-id-number-for-v15/ Link to comment Share on other sites More sharing options...
arancia Posted May 20, 2013 Share Posted May 20, 2013 hello, I have installed the module and it has also changed all links to images so no product images are showing right now. What do I have to do? Regards Arantza Link to comment Share on other sites More sharing options...
robbie007 Posted May 20, 2013 Share Posted May 20, 2013 Go to preferences --> SEO & URL, turn friendly URL's off (safe) and then turn back to on. Htaccess file will then be refreshed and images will show up again. Link to comment Share on other sites More sharing options...
arancia Posted May 20, 2013 Share Posted May 20, 2013 already tried that but nope Link to comment Share on other sites More sharing options...
Dmit Posted May 21, 2013 Share Posted May 21, 2013 (edited) @Dmit For 1.5xx see post http://www.prestasho...number-for-v15/ Tried to put the module cleanurls_v0.3.1.zip for PS 1.5.4.1 , but nothing came of it says page not found SEO settings did as it is written Edited May 21, 2013 by Dmit (see edit history) Link to comment Share on other sites More sharing options...
detlev Posted October 30, 2013 Share Posted October 30, 2013 Module works perfect on my Prestashop 1.4. Could you make a module wich deletes the .html and .php from the url? Link to comment Share on other sites More sharing options...
White Lion Posted November 5, 2013 Share Posted November 5, 2013 Hello friends What are the benefits, remove id from friendly URLs? Link to comment Share on other sites More sharing options...
ramesh25 Posted November 5, 2013 Share Posted November 5, 2013 Hi All, How to implement the ws-* security in prestashop? for example with SOAP using xml. is there any module available for this? Thanks, Ramesh. Link to comment Share on other sites More sharing options...
raakeshkumar Posted February 3, 2014 Share Posted February 3, 2014 Hi everyone, First of all i want to thank you for the solution. I followed the steps you mentioned earlier and everything worked well except when i open the category page, product images doesn't show up and when i try to open the image in new tab, it shows "missing category id" error. http://femella.in is my website and when you go to http://www.femella.in/knitwear , it doesn't display images. Please help me on this. My website is live so i will loose customers if it stays there for a long time in this state. Thank you Link to comment Share on other sites More sharing options...
JaivyDaam Posted February 4, 2014 Share Posted February 4, 2014 Hello All, i tried the module on my dev site and with a few changes it is working like a charm!!!! But before i add this to my live site, what are consequences with search engines? I already have about 500 pages indexed by Google, do i need to remove all the links? or does google this automaticly? Thank you in advance! Link to comment Share on other sites More sharing options...
El Patron Posted August 22, 2014 Share Posted August 22, 2014 it's a slippery slope when you change core...just saying 1 Link to comment Share on other sites More sharing options...
benjamin utterback Posted August 22, 2014 Share Posted August 22, 2014 it's a slippery slope when you change core...just saying Agreed, this is not recommended. Link to comment Share on other sites More sharing options...
El Patron Posted August 23, 2014 Share Posted August 23, 2014 I am closing this topic, see this link for module and if you have questions of the developer post there. Note: it is recommended not to change core, there is no-known issue with using cat/prod id's in url. happy prestashopping. http://www.prestashop.com/forums/topic/189443-override-friendly-urls-without-id-number/ Link to comment Share on other sites More sharing options...
bincyclt Posted February 8, 2016 Share Posted February 8, 2016 Nothing worked with 1.6 Link to comment Share on other sites More sharing options...
akanshabhatt32 Posted September 11, 2017 Share Posted September 11, 2017 Hey i have an e-com portal that generate some id in their last few word, does this harm the google rank? Please suggest some good seo farm for http://www.planeteves.com/categories/women-bags--accessories/cid-CU00206898.aspx Link to comment Share on other sites More sharing options...
Zohaib-fk Posted September 28, 2017 Share Posted September 28, 2017 (edited) Hi, One way to check google parse new urls without ids using webmaster tool. There is option name like "Fetch as Google" in Crawl option in left menu. This option allows to submit urls to fetch. PrestaShop Tutorials Videos [How to do Tasks] https://www.prestashop.com/forums/topic/907438-prestashop-tutorials-videos-how-to-do-tasks/ Edited June 30, 2021 by Zohaib-fk Post Updated (see edit history) Link to comment Share on other sites More sharing options...
trivanksvinks Posted October 30, 2018 Share Posted October 30, 2018 Well How to implement the ws-* security in prestashop? for example using xml. is there any module available for this? Thanks... 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