Jump to content

.htaccess 301 Redirect Issue


anthonygustin
 Share

Recommended Posts

Hey all, things had been going well remapping a site from one domain to another, but hit a snag and have searched for hours and don't know how to continue. 

1) I was moving everything from thepaleofix.com to dranthonygustin.com

2) I moved every single path individually with redirects like this: Redirect 301 /category/post http://www.dranthonygustin.com/category/post

Everything smooth sailing until today when through webmaster tools (to say site address as moved) I had to execute "Redirect 301 / http://www.dranthonygustin.com" -- now some of the urls go through and some don't include the / after the .com extension. 

For example:

http://www.thepaleofix.com > http://www.dranthonygustin.com no problem 

http://www.thepaleofix.com/resource/purepharma-m3-review/http://www.dranthonygustin.com/what-does-magnesium-do/ no problem

BUT a bunch of the URLs then don't push... For example:

http://www.thepaleofix.com/recipe/paleo-jam > http://www.dranthonygustin.comrecipe/paleo-jam/ (notice NO / after the .com extension)

and http://www.thepaleofix.com/wp-admin > http://www.dranthonygustinwp-admin (which of course leads to dead link)

There are a bunch of paths that do this, that I checked before and were working, such as: 

Redirect 301 /recipe/paleo-jam http://www.dranthonygustin.com/simple-vanilla-berry-paleo-jam/
 

Any idea why after implementing the / redirect, why it broke some of the redirects and not all? 

 

Thanks! 

Link to comment
Share on other sites

you would need something like this in your old site's root folder htaccess

RewriteEngine On
RewriteCond %{HTTP_HOST} www.thepaleofix.com.com [NC]
RewriteRule ^(.*)$ http://www.dranthonygustin.com/$1 [L,R=301]

Once the URLs are all forwarding from the old domain, you would then use a combination of htaccess 301, and Jumplinks (module) to handle the differences.

because with the above rules if someone requests

http://www.thepaleofix.com/resource/purepharma-m3-review/

they will definitely be redirected to

http://www.dranthonygustin.com/resource/purepharma-m3-review/

so then your local 301 or Jumplink would do the 2nd 301 to the new page

  • Like 2
Link to comment
Share on other sites

  • 2 years later...
On 9/28/2016 at 3:59 AM, Macrura said:

ok right, well my technique uses 2 redirects, but does guarantee that every page on the site gets redirected to it's new counterpart without having to do anything extra.

 

hey can you help me here, I tried your method above but it doesn't work

https://processwire.com/talk/topic/20554-mysitecom-redirected-you-too-many-times/

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...