Mobile app version of vmapp.org
Login or Join
Tiffany637

: 301 redirect conflicts with cname redirect for both naked and www URL Client had created a cname redirect for their www url which goes to their new web address, they were told to create a

@Tiffany637

Posted in: #301Redirect #Cname #DnsServers #Domains #Htaccess

Client had created a cname redirect for their www url which goes to their new web address, they were told to create a 301 redirect for the naked url but it's conflicting with the cname and the www url no longer redirects. How do I fix this?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Tiffany637

1 Comments

Sorted by latest first Latest Oldest Best

 

@Heady270

A CNAME is NOT are redirect. A CNAME is a type of DNS entry that tells the DNS resolver to do another DNS lookup under a different name.

A DNS record for a site often looks like:

example.com. IN A 69.9.64.11 example.com IN CNAME example.com.


That means that when a user types in example.com, then:


The DNS client queries example.com and gets 69.9.64.11
The web browser issues a request to 69.9.64.11 and sends the host name example.com
The web server return the index document
The user sees the content and example.com in their URL bar


When the user tyes in example.com then


The DNS client queries example.com and is told to look at example.com
The DNS client queries example.com and gets 69.9.64.11
The web browser issues a request to 69.9.64.11 and sends the host name example.com The web server return the index document
The user sees the content and example.com in their URL bar


If you want to redirect one to the other, you don't need to change DNS at all. 301 redirects can be implemented regardless of DNS configuration. Both A records and CNAME records work fine. If you want to use 301 redirects from example.com to example.com then the steps that are taken when a user types in example.com would be:


The DNS client queries example.com and is told to look at example.com
The DNS client queries example.com and gets 69.9.64.11
The web browser issues a request to 69.9.64.11 and sends the host name example.com The web server returns a 301 redirect to example.com/ The DNS client queries example.com and gets 69.9.64.11
The web browser issues a request to 69.9.64.11 and sends the host name example.com
The web server return the index document
The user sees the content and example.com in their URL bar


To make this work, your webserver need to be configured to issue the 301 redirect unless the domain name is canonical.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme