Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redirect non-www to www using DNS Zone Editor?

I've just purchased a new traffic tracking service, which requires my domain (registered at GoDaddy) to have a CNAME record pointing to their servers.

I've done that fine, and it's now working.

However, when typing it in without the "www", I get a 404 error page.

My question is, what would I type in the DNS Zone Editor to redirect my "non-www" domain to the "www" domain?

For example, I need my URL to do this…

http://mydomain.com/1234 --> http://www.mydomain.com/1234

Would it be done using an "A name record" or something? Or another way?

I've searched everywhere and can't find a solution that works, so hopefully you can help.

Thanks, James.

like image 400
James Francis Avatar asked Jan 25 '13 11:01

James Francis


People also ask

How do I redirect www to non-www in DNS?

Go to the record editor and two DNS records, one for each host name, pointing to the Heroku SSL endpoint: Add an ALIAS record to point example.com to Heroku. Leave the Name of the record empty and set the Content field to the SSL endpoint example.com.herokudns.com. Add a CNAME record to point www.example.com to Heroku.

How do I redirect a website to www?

Select the Redirects icon under the Domains area of your cPanel home page. Keep the Type as the default, Permanent(301). Select your domain name from the drop down menu on the next line. In the redirects to text box, type in the full URL of your domain, including www (e.g. http://www.yourdomain.com).


2 Answers

Assuming you just want to send all traffic from mydomain.com (known as your 'naked' domain) to www.mydomain.com you should be able to use domain forwarding. In GoDaddy this will be in the Domain Manager under "Domain Information" at the bottom.

like image 135
eziegl Avatar answered Nov 14 '22 06:11

eziegl


For those having their servers with AWS and domain registered at Godaddy:

I set up my A record with 2 entries (Host: @ and www) as below to redirect to my server in AWS through the public ip. This catches the URLs with/without the www prefix

enter image description here

like image 45
Shankar ARUL Avatar answered Nov 14 '22 06:11

Shankar ARUL