On my example.com domain name at Godaddy's page, I set a CNAME record www to point to test.somedomain.example. So if a user types in www.example.com, it will takes him to test.somedoman.example.

My question is I how can I configure example.com to point to www.example.com? That way if a user types in example.com or www.example.com, both will take him to test.somedomain.example


Erik's answer is correct if you just want the domains to alias each other. Although, it's better for user experience and SEO purposes to use an HTTP redirect using a .htaccess file in your web root. Or, GoDaddy may provide soem more user friendly means of doing this.

If not, just create a file named .htaccess in the FTP directory for example.com with the line:

Redirect 301 / http://test.somedomain.example

Then anyone who has their browser visit example.com will be redirected to test.somedomain.example - and you'll help out your search engine rankings.


Just add a CNAME record for example.com pointing to www.example.com, or to test.somedomain.example. No problem...


At GoDaddy, you can set up domain forwarding to redirect your domain.

When you chose a CNAME for www, that points the domain to the same IP address as test.somedoman.example. It is up to the server at that address how to handle the request for your domain. It could:

  • Redirect to test.somedoman.example
  • Show the same content as test.somedoman.example
  • Show entirely different content altogether
  • Give an error

The CNAME itself doesn't redirect. It just causes requests to get routed to the same server as the other domain. That is why using GoDaddy's domain forwarding is usually preferable.

If the server at test.somedoman.example is (or could be) configured to redirect properly, you could also point the bare domain (apex) there. However, you can't use a CNAME record for that. For the domain apex you would need to use an A record with the IP address of server for test.somedoman.example. So your records could look like where @ is usually used to represent the bare domain (domain apex, example.com with no www:

@     A       xxx.xxx.xxx.xxx
www   CNAME   test.somedomain.example

or you could just use the A record in both cases:

@     A       xxx.xxx.xxx.xxx
www   A       xxx.xxx.xxx.xxx

Your Answer

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