I try to redirect with CNAME DNS entry.
www.example.com -> othersite.com
when I type www.example.com I receive a "File not found" error. There is a file: othersite.com/index.html What file the message refers to?
I try to redirect with CNAME DNS entry.
www.example.com -> othersite.com
when I type www.example.com I receive a "File not found" error. There is a file: othersite.com/index.html What file the message refers to?
A CNAME
record in DNS is not an HTTP redirect, it's an alias within DNS itself.
Ie, in your example it makes it so that a query for www.example.com
will resolve the same as a query for othersite.com
does.
In your example, that would leave a visitor still at http://www.example.com/
, connecting to whatever IP address is associated with the name othersite.com
.
If the web server hosting othersite.com
does not like the Host: www.example.com
HTTP header, it may well return an error or some default page instead of the content it would serve for Host: othersite.com
.
Please provide your dns configuration with dig or nslookup (anoymized)
You can also do a curl, then you see exactly what http does
curl -v https://www.site123.com/
Your Apache(whatever)'s virtualhost should include othersite.com
to accept this new domain ( as this is the domain that is pointing/accessing your server )
Place it under ServerAlias othersite.com
(i.e) but this is a web server issue not a DNS issue