Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We have a completely new website on a new server with a new domain name. Currently we use the following line in httpd.conf of the old server to redirect users who visit the old site to the new one:

Redirect permanent / http://newsite

Likely at some point the old server will not be needed at all, and will be shut down. So from my understanding, old domain name would need to be redirected to new site using DNS.

Is it the matter of simply updating the DNS record for old domain name to point to the new IP? Will the new web server respond correctly? Should something be configured on the new server for this solution to work?

share|improve this question

3 Answers 3

up vote 2 down vote accepted

The redirection will work once you change the DNS, yes, but the new server has to be aware of the old domain name as well; if using apache, you'll need to add a ServerAlias olddomain to your VirtualHost section so that your new server knows what to do with requests for the old domain name. Similar directives exist for other web servers.

Alternatively, you can create a dedicated VirtualHost for the old domain name on the new server to redirect to the new domain name; it's always better to have a single domain name for SEO purposes.

Those two operations can be done right now, you don't have to wait for the DNS change.

share|improve this answer

Yes, that would work. However, anyone that followed a deep link to the old site (http://oldsite/pages/whatever) would likely get a 404 Not Found error.

What I would do is create a virtual host on your new web server with the old domain name and redirect it like you are now.

share|improve this answer

Be aware when you change a DNS name the change can take some time to work due to DNS TTLs.

You should find out what the TTL is for the old servername. Say it was 86400 seconds (24 hours - that is a common value).

Then at least 24 hours before you plan to make the move you need to change that ttl from 86400 to a much lower value, e.g. 300 seconds (5 mins).

That will mean when you do make the change it will only take a maximum of 5 minutes to propogate to DNS servers which follow the rules.

Basically the old servername's old IP can be cached for what ever the TTL is on DNS servers around the network. So if the TTL is 86400 when you change the old servernames IP it can take up to 86400 seconds for the various DNS servers around the net to clear their caches.

share|improve this answer
    
I am not administering the name server in question myself, but as far as I know the TTL is already set to 300 sec. –  phs Jun 11 '13 at 17:52
    
Then no problems. As you say, change oldname to point to new ip. As noted above a ServerAlias is also a good idea. –  Jason Tan Jun 11 '13 at 17:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.