So, I submitted an answer to this SO question about redirecting your site, however I began to think about the intricacies of it, especially with Rody van Sambeek’s answer about finding all of your site’s URL’s and submitting a redirect for each one. I have never actually needed a 301, so I only know it academically. And I could not seem to find anything via numerous google searches. So, I was hoping that somebody who has a little more knowledge on redirects could answer this question:
How many 301 redirects are really needed when your base domain moves? Do you need just one for the base domain, which will be picked up for all of your links since it is the base? Or, do you, in fact, need to submit a 301 for each and every page?
Here is a very basic example:
Original setup:
New setup:
So, do I submit 2 301’s:
- http://www.mydomain.com -> http://www.newdomain.com
- http://www.mydomain.com/About -> http://www.newdomain.com/About
OR
do I need just one 301:
If you move whole site, need to set up just one redirect, but one which will catch any path on old domain and redirect that to corresponding URL on new domain. For example in case of Apache it would be:
This will redirect
www.olddomain.com/anything/at.alltowww.newdomain.com/anything/at.all