Jump to content

How to do internal prestashop 301 redirect


Recommended Posts

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

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

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

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

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?

  • Like 3
Link to comment
Share on other sites

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

  • 1 month later...

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

  • 1 year later...
×
×
  • Create New...