Tell me more ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

Is it possible to forward firstdomain.com to www.seconddomain.com or seconddomain.com using surely dns records? I know how to forward www.firstdomain.com to seconddomain.com (with CNAME).

What I am trying to do is move my site from one domain to another (new) one, and not break all the links which use the old domain name. I can't do a 301 redirect as it's hosted on Github Pages and I don't have access to the webserver.

Thanks

share|improve this question

2 Answers

I eventually gave in and solved this with a Apache config redirect (although I wanted to do it with pure DNS it looks like this is not possible...)

<VirtualHost *:80>
DocumentRoot /www/html/firstdomain.com
ServerName firstdomain.com
RedirectMatch 301 ^(.*)$ http://seconddomain.com$1
ErrorLog logs/firstdomain.com-error_log
TransferLog logs/host.example.com-access_log
</VirtualHost>
share|improve this answer

What's wrong with a simple CNAME DNS entry?

CNAME redirect

share|improve this answer
What's wrong with it is that, as far as browsers and search engines are concerned, those would be two completely different domains with (assuming no funny webserver tricks) the same content. Of course, you can first use a DNS CNAME to make your old domain an alias for your new one, and then configure the webserver at your new domain to HTTP 301 redirect any requests for URLs on your old domain to the new one. – Ilmari Karonen Apr 4 at 14:56

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.