I am trying to understand why does my website always get redirected to the naked domain version of it. For e.g.:

www.example.com gets redirected to example.com

I purchased my domain name from godaddy and am using github (scroll to custom domains) for hosting it. (sidenote: I don't quite understand the concept of CNAME and A-records)


The key is in this sentence:

The server will set your pages to be hosted at example.com, and create redirects from www.example.com and charlie.github.com to example.com.

"The server" is the github server and they've put a redirect on that from www to the naked domain. They could if they wanted to make www.example.com not redirect. You could ask through support that they don't do this, but they may not want to do a special for you.

| improve this answer | |

If you've purchased your domain through Google with eNom as your registrar, you can configure your naked domain to point to your mapped CNAME (subomain) through the following steps:

Log into your Google Apps control panel at http://www.google.com/a/example.com
Select Domain Settings >> Domain Names >> Advanced DNS
Locate the provided username and password for your eNom DNS control panel and make note of them before clicking on the Sign in to DNS Console link
Click Edit under the Host Records section
Delete any existing A records
Add a new Host Record with the following configuration (see sample image below):
    Host Name:  @
    Address:  http://www.wallpaper66.com
    Record Type:  URL Redirect
Save your changes
| improve this answer | |

It has to do with the way the web server is set up. This is so the www does not have to be included in the URL (since nobody really uses it anymore anyway). If it wasn't for this typing example.com might not take you to the website, where as typing www.example.com would (or vice versa).

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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