[Pdns-users] redirect a search for one site to another site
bert.hubert at netherlabs.nl
Sat Dec 25 22:28:09 UTC 2010
On Sat, Dec 25, 2010 at 05:13:47PM -0500, Morgan Osborne wrote:
> The first is 'red.com' with a record type of 'CNAME' and content of
> 'blue.com' , then the second record is 'blue.com' with a record type of
> 'A' and the correct IP address of '184.108.40.206' So now when I do a http
> search for 'red.com' I get to the error site of '220.127.116.11' and not all
> the way to the site of 'blue.com'
This is indeed how DNS works. A CNAME works 'behind the scenes'. What you
are looking for is a HTTP-level redirect such as a 301 or 302 directive.
This will instruct the browser to go 'all the way' to blue.com.
For Apache, this is documented on
> 1. I am not inserting the records correctly, or using the wrong record types
> 2. The CNAME does not send back to the http search the 'blue.com' name so
> when it gets to site '18.104.22.168' it does not know what to look for (and
> is probably looking for 'red.com' instead of 'blue.com' and thats why I
> get the error page)
> 3. I should not be using CNAME for a redirect, but some other record type
> 4. or, the Aliases in the record is interrupting the search somehow on '22.214.171.124'
'2' is the one you are looking for.
More information about the Pdns-users