KeydownR Posted March 29, 2019 Share Posted March 29, 2019 Hi everyone! Thanks in advance if you can help! I'm looking to write a rule in the htaccess of my recently migrated 1.7 shop I was thinking that prestashop would have made the redirection of the old urls for the brands but after checking the indexed urls on Google it appears that their pointing to a 404 error page Could you help me to write the htaccess rules with the right regex? It seems that on 1.6 the urls for the brands were : ID_BrandName And on 1.7 it's : /brand/ID-BrandName Thanks for everything! Link to comment Share on other sites More sharing options...
KeydownR Posted May 20, 2019 Author Share Posted May 20, 2019 If it can help anybody : #Htaccess # Brands RewriteCond %{HTTP_HOST} ^www.example.com$ RewriteRule ^([0-9]{1,5})_(.*)(?<!xml)$ /brand/$1-$2 [R=301,L] Have a nice day Link to comment Share on other sites More sharing options...
Mr. Trice Posted June 21, 2021 Share Posted June 21, 2021 On 5/20/2019 at 7:54 AM, KeydownR said: If it can help anybody : #Htaccess # Brands RewriteCond %{HTTP_HOST} ^www.example.com$ RewriteRule ^([0-9]{1,5})_(.*)(?<!xml)$ /brand/$1-$2 [R=301,L] Have a nice day I need this but this code did not work for me. Link to comment Share on other sites More sharing options...
Mr. Trice Posted June 21, 2021 Share Posted June 21, 2021 10 minutes ago, Mr. Trice said: I need this but this code did not work for me. This is what worked for me. #Htaccess # Brands RewriteCond %{HTTP_HOST} ^example.com$ RewriteRule ^([0-9]{1,5})_(.*)(?<!xml)$ /brand/$1-$2 [R=301,L] Link to comment Share on other sites More sharing options...
Mr. Trice Posted June 21, 2021 Share Posted June 21, 2021 29 minutes ago, Mr. Trice said: I need this but this code did not work for me. This is what worked for me. #Htaccess # Brands RewriteCond %{HTTP_HOST} ^example.com$ RewriteRule ^([0-9]{1,5})_(.*)(?<!xml)$ /brand/$1-$2 [R=301,L] But i have one issue now. It affects Suppliers with thesame ids of brand Link to comment Share on other sites More sharing options...
CPTBombaxx Posted June 3, 2022 Share Posted June 3, 2022 (edited) I know its old topic , but i want to do opposite. We have newer version of presta and links in Brands tab are okay with "_" but our sitemap generator still wants to index some sites like /brand/83-brandname?page=3 with hyphen so for seo we don't want 404 with robots. I tried just to switch hyphen with underscore from rules from this post but nothing works, or maybe i'm editing wrong .htaccess . ON which one i should focus for brands? The one in main folder or should i create new one in some other folder? Edited June 3, 2022 by CPTBombaxx (see edit history) Link to comment Share on other sites More sharing options...
El Patron Posted June 10, 2022 Share Posted June 10, 2022 on addons we use linegraphia rewrite module on client shops rewrite module is a must to manage your shop 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