38

So I have some domains hosted at GoDaddy.com. I am trying to avoid to pay for a hosting service, except for using a static Amazon S3 page (as I don't expect much traffic at all for these sites). I have had some success, but not sure if this is a poor solution...

What I did for domain.com:

  1. Set up permanent forwarding on GoDaddy to www.domain.com

  2. Remove all DNS except for the A address to the GoDaddy IP, and a CNAME of www to the Amazon S3 site

It works as planned if someone types in www.domain.com. It seems to work alright for domain.com, too. However, it seems to do a 302 redirect instead of 301 even when I tell GoDaddy to have it be a permanent forward. I can ultimately goto Google Webmaster tools and say that I want it to use www.domain.com. However, that seems a little excessive.

Any suggestions on how to make this solution work better?
Possibly by changing some of the DNS settings or some other GoDaddy options that I don't know about?

1

2 Answers 2

86

You must name your S3 bucket the same as your domain, "www.example.com" Make sure you include the "www." subdomain prefix as part of the bucket name.

Set up your bucket as a web site per Amazon's instructions!. Make sure you have an "index.htm" file name entered and the correct bucket policy setup under Permissions.

Under Godaddy DNS settings make just one entry, set Host WWW CNAME, points to, "s3-website-us-east-1.amazonaws.com" or whatever s3 domain Amazon supplies for your bucket. You leave off the "http://www.example.com." heading in the url that Amazon supplies.

The last step under Forwarding/manage is to "forward only" your naked domain name "example.com" to "www.example.com"

If you did it right your browser will display your site as "www.example.com" whether you entered the www or not when you entered the url.

NOTE: You could just Forward to your bucket using the complete bucket url with "name masking", however most web crawlers will not see your complete site if you do it that way and web searches will fail.

Be sure to wait at least 30 minutes before testing your changes and by all means clear your cache in your browser or it will use the old address that it remembers from the past.

2
  • 5
    Hi I tried doing something like this cname www mydomainname.in.s3-website.ap-south-1.amazona now the problem is the website opens with www.mydomain.com , but not with mydomain.com Mar 21, 2018 at 6:47
  • 1
    How about having https on top of that conf ?
    – Rayjax
    May 31, 2018 at 17:01
3

The DNS-apex-requires-an-A-record problem is definitely not well solved.

I can't personally vouch for them, but www.wwwizer.com hosts a free redirect service.

0

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