barrystein Posted March 14, 2012 Share Posted March 14, 2012 I am trying to redirect one prestashop page to another, when i try to add the code to the .htaccess file, or the .htaccess generator I get errors Old Page: http://www.homeschool-shelf.com/en/content/12-video-overviews-switched-on-schoolhouse New Page: http://www.homeschool-shelf.com/en/content/27-video-overviews-switched-on-schoolhouse Here is the code I am trying to put into the .htaccess Redirect 301 /en/content/12-video-overviews-switched-on-schoolhouse http://www.homeschool-shelf.com/en/content/27-video-overviews-switched-on-schoolhouse The error I get is: This webpage has a redirect loop The webpage at http://www.homeschool-shelf.com/en/content/12-video-overviews-switched-on-schoolhouse has resulted in too many redirects. Clearing your cookies for this site or allowing third-party cookies may fix the problem. If not, it is possibly a server configuration issue and not a problem with your computer. So how do I do a 301 redirect of one prestashop page to another? Link to comment Share on other sites More sharing options...
Mark Hesketh Posted March 15, 2012 Share Posted March 15, 2012 Not sure the exacts on this but have you tried putting the 301 rule above and then below Prestashop's rules to see which works? Also, would just editing page #12 not be an option? I'm fairly certain if you keep the 12 in the URL, the bit after can be changed as the rewrite is based on this number as the ID. Mark Link to comment Share on other sites More sharing options...
musicmaster Posted March 15, 2012 Share Posted March 15, 2012 I was a bit puzzled that you use the domainname in the second part of the 301 line. Did you try it without? Link to comment Share on other sites More sharing options...
barrystein Posted March 15, 2012 Author Share Posted March 15, 2012 I am trying to redirect page #12 to a new page, not edit the old page. I have tried all different positions, above and below in the .htaccess file - none work, I have tried putting it in the .htaccess generation page in the back office and still get the same problem Not sure the exacts on this but have you tried putting the 301 rule above and then below Prestashop's rules to see which works? Also, would just editing page #12 not be an option? I'm fairly certain if you keep the 12 in the URL, the bit after can be changed as the rewrite is based on this number as the ID. Mark Link to comment Share on other sites More sharing options...
barrystein Posted March 15, 2012 Author Share Posted March 15, 2012 Just tried it, still get the same error I was a bit puzzled that you use the domainname in the second part of the 301 line. Did you try it without? Link to comment Share on other sites More sharing options...
Mark Hesketh Posted March 16, 2012 Share Posted March 16, 2012 I am trying to redirect page #12 to a new page, not edit the old page. But why? You'd usually redirect if the domain had changed, or the URL structure was different but it appears to be the same here? Wouldn't editing the original page with new content at the current link give the same result overall? How about before the Prestashop rules, but after the RewriteEngine On declaration? Does your apache error_log show anything? Link to comment Share on other sites More sharing options...
musicmaster Posted March 16, 2012 Share Posted March 16, 2012 You might have a look at this article: http://www.communitymx.com/content/article.cfm?cid=51C62 Link to comment Share on other sites More sharing options...
barrystein Posted March 16, 2012 Author Share Posted March 16, 2012 I figured out how to do it. I was using the wrong code. For some reason the below code does not work: Redirect 301 /en/content/12-video-overviews-switched-on-schoolhouse http://www.homeschoo...-on-schoolhouse I started playing with code and the following code does work: RewriteRule ^en/content/12-video-overviews-switched-on-schoolhouse /en/content/27-video-overviews-switched-on-schoolhouse [R=301,L] I checked it and it produces a perfectly good search engine friendly 301 redirect. Also I can input the code in to the back office .htaccess generation page, and it places the code for me automatically in the file. The reason I need to do a 301 redirect is I am selling a 2011 product version till April 1 and selling a 2012 version at a different price that starts shipping April 1. The friendly URL will change, so I needed a way to redirect the old pages to the new pages once the 2011 product is retired. Thanks for all the help. But why? You'd usually redirect if the domain had changed, or the URL structure was different but it appears to be the same here? Wouldn't editing the original page with new content at the current link give the same result overall? How about before the Prestashop rules, but after the RewriteEngine On declaration? Does your apache error_log show anything? 3 Link to comment Share on other sites More sharing options...
barrystein Posted March 16, 2012 Author Share Posted March 16, 2012 Thanks for that.... great link You might have a look at this article: http://www.community...e.cfm?cid=51C62 Link to comment Share on other sites More sharing options...
Mark Hesketh Posted March 17, 2012 Share Posted March 17, 2012 Glad you got it sorted Can't figure out why all it took was te ^, but then I've always been crap with regex.. Link to comment Share on other sites More sharing options...
mindhaze Posted March 23, 2012 Share Posted March 23, 2012 I figured out how to do it. I was using the wrong code. For some reason the below code does not work: Redirect 301 /en/content/12-video-overviews-switched-on-schoolhouse http://www.homeschoo...-on-schoolhouse I started playing with code and the following code does work: RewriteRule ^en/content/12-video-overviews-switched-on-schoolhouse /en/content/27-video-overviews-switched-on-schoolhouse [R=301,L] I checked it and it produces a perfectly good search engine friendly 301 redirect. Also I can input the code in to the back office .htaccess generation page, and it places the code for me automatically in the file. The reason I need to do a 301 redirect is I am selling a 2011 product version till April 1 and selling a 2012 version at a different price that starts shipping April 1. The friendly URL will change, so I needed a way to redirect the old pages to the new pages once the 2011 product is retired. Thanks for all the help. Works like a charm! Thank you! Link to comment Share on other sites More sharing options...
virginmary Posted May 17, 2012 Share Posted May 17, 2012 Hi, I have had older files in my prestashop (rosary.name/shop) Version 1.3.3.0. The old files which I have disabled I can't seem to redirect to the newer files. Example: http://www.rosary.na...on-kit-kc2.html This is the older one (disabled in the shop), and should go to the new location which is: http://www.rosary.na...ry-kit-kc2.html Because I have my shop on a folder named /shop on a domain, instead of being the root folder on the domain, thus I have in my simplicity tried in both .htaccess files (one in domain second in /shop) to write this redirect rule: Redirect 301 /shop/75-black-first-communion-kit-kc2.html http://www.rosary.na...ry-kit-kc2.html But I can't to get them to work. What's going on? Could this be due to that they are disabled on the shop? The result shows: http://www.rosary.na...l?id_product=75 And I get a message on that location which says: There is 1 error : product is no longer available Please let me know. Regards. Link to comment Share on other sites More sharing options...
matteo_mont Posted January 6, 2014 Share Posted January 6, 2014 (edited) Hi there, I'd need to redirect http://falloperte.com/it toward http://falloperte.com/ any help is appreciated Cheers, Matteo Redirect 301 of course... Edited January 6, 2014 by matteo_mont (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted January 7, 2014 Share Posted January 7, 2014 hello how many languages you've got enabled? just disable unused languages (disable, not remove) and it will work like that Link to comment Share on other sites More sharing options...
matteo_mont Posted January 7, 2014 Share Posted January 7, 2014 hi Vekia, thanks for the workaround, but for several reasons I cannot follow it. Can you explain me how to edit the redirect please. I guess a kind of RewriteRule falloperte.com/it falloperte.com [R=301,L] Thanks Link to comment Share on other sites More sharing options...
matteo_mont Posted January 7, 2014 Share Posted January 7, 2014 het there, I got the solution, in my case was Redirect 301 /it http://falloperte.com I wrote it in .htaccess file for more information you can have a look this link http://www.lionseo.com/blog/htaccess-redirect-301/ Link to comment Share on other sites More sharing options...
Recommended Posts