Rulian Posted March 8, 2016 Share Posted March 8, 2016 Hi, I'm currently migrating an e-commerce website from a 'homemade PHP' solution to Prestashop 1.6 (keeping the same domain name). The shop has about 20,000 unique products and we can't keep the original URL scheme in the new Prestashop website. So I'm about to make a list of 301s redirections, from 2 freshly generated sitemaps (one from the old website, the other one from the new PS website). I'm kind of a newbie to the SEO stuff, so I'm a little bit concerned about adding 20,000 lines of 301s in my .htaccess file. Is it the best way to do it ? Is there any other way ? Thanks for your help and have a nice day. Link to comment Share on other sites More sharing options...
prestatent Posted March 8, 2016 Share Posted March 8, 2016 (edited) Hi We did this a couple of times over the past year and it works well although only for about 900 products. Don't forget this is a temporary solution until google for example has indexed all your products with the new url. Once all your new urls are indexed you could remove the 301's for .htaccess. You probably know this but don't forget to put your 301's at the top of the .htaccess file above the line as below: # ~~start~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again There are other guys on here who have more experience than me on this, and they may be able to suggest a better solution but this way will work. Cheers Edited March 8, 2016 by prestatent (see edit history) Link to comment Share on other sites More sharing options...
Rulian Posted March 8, 2016 Author Share Posted March 8, 2016 Thanks for sharing your experience! I'll stick to the 301 list in the .htaccess file then. Well, if I'm able to make it work since I can't achieve such a thing on my local dev server. I access my dev PS instance at http://localhost/prestashop/ I added at the beginning of the .htaccess file located at the root of my prestashop install, the folowing line: Redirect 301 http://localhost/prestashop/foo/item-bar.html http://localhost/prestashop/16492-bus-strike.html where http://localhost/prestashop/16492-bus-strike.html is an actual page, and I still get a 404 page when I ask for http://localhost/prestashop/foo/item-bar.html Furthermore, does someone know if I need to restart Apache ? If so, I'm kind of stuck since the production PS instanc is on a shared webserver (1and1)... Link to comment Share on other sites More sharing options...
prestatent Posted March 8, 2016 Share Posted March 8, 2016 (edited) Hi Here's an example which works. You may want to rework yours to this format. You may not need "([a-z]{2})" as I use different languages for example gb. RewriteRule ^([a-z]{2})/2-old-category/8-old-product.html$ http://www.mysite.com/10-new-category/22-new-product.html [NC,R=301,L] I think this should work ok on localhost. I don't think you need to stop and restart apache locally. I think this only applies if you make any changes to php.ini. On shared hosting it does not matter. It will be ok. By the way, in my experience 1and1 are not the best. Hope this helps. Cheers Edited March 8, 2016 by prestatent (see edit history) Link to comment Share on other sites More sharing options...
Rulian Posted March 15, 2016 Author Share Posted March 15, 2016 (edited) Hey, thank you for the info. Actually, the Apache server behind my shared hosting plan seems to be fine with the +10,000 lines of (working ) redirections. > By the way, in my experience 1and1 are not the best. True. But the owner got a 'all in one' plan, including domain name, hosting, mail addresses and SSL certificates. It would be a PITA to move to another webhosting provider. We'll probably do it sooner or later though, since PS is kind of a resources hog Edited March 15, 2016 by Ruliane (see edit history) 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