Welcome to WebmasterWorld Guest from 54.162.239.134

Message Too Old, No Replies

Change of domain name & 301 redirects

     
10:35 am on Apr 22, 2012 (gmt 0)

5+ Year Member



My client has had a site on a domain for the last year and now because of a copyright issue they have to change the domain and I am unsure of the best way to handle this.

The have bought the new domain and the nameservers are pointing to the hosting space and obviously the hosting company can now change it so the website comes up for the new domain.

BUT how do we notify Google, etc that it is the same site but just a new domain? I think we need a 301 redirect somewhere (assume htaccess) but if the old domain no longer has its own space how does this work?
6:38 pm on Apr 22, 2012 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



Easiest solution first: Check with the previous host. They may be able to redirect-- although maybe only to your new index page. You don't want that if the overall site is the same.

Do you have to give up the previous site's physical space? Take a quick look through the Apache forum and you will see that redirecting page-for-page from an old domain to a new one involves a single line in htaccess. You don't need to keep any files in the old place, just the htaccess.

There is a category in GWT under Site Configuration called "change of address". That's what you want.
7:29 am on Apr 23, 2012 (gmt 0)

5+ Year Member



The new domain will be using the space currently used for the first domain and the site is staying exactly the same.
8:10 am on Apr 23, 2012 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



Do the change of address at gwt.

And ask the host if they do page-for-page redirects (as opposed to just dumping everyone on the new domain's index page). No point in doing the work yourself if they have a few lines of code that can be activated with a single button click. Especially if the new domain is occupying the same physical directory space as the old one.

You can only redirect if the old place exists in some way-- that is, the DNS has to point somewhere. If you've had to pull the plug entirely-- telling the DNS that this domain name no longer exists anywhere-- then you're out of luck. Otherwise, it's a single line in htaccess.

Come to think of it, you don't even need to add anything. You've probably already got the code you need. If you've got a name-canonicalizing routine like

RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]

just change it from the old name to the new name, and put it where requests for the old name will see it. (Check with the host. Some things can go in shared htaccess for a userspace leading to more than one domain, but some things have to go one level lower, in the domain's individual directory.)
 

Featured Threads

Hot Threads This Week

Hot Threads This Month