Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to host a website on Amazon S3. What's the best practice to make a site accessible from both example.com and www.example.com?

share|improve this question

You should choose one version to use and 301 redirect from one to the other. I don't know if you can use a htaccess file on S3 but if not you may be able to do the redirect from you domain name's control panel.

share|improve this answer
No, .htaccess can't be used with S3 (that's an Apache specific file). Since S3 can't host naked domains, only subdomains because it uses a CNAME record, you would host www.example.com in the bucket and redirect example.com to the bucket. – Anders Dahnielson Jan 10 '12 at 8:37

Amazon offers a free micro server for one year. http://aws.amazon.com/free/ you may be better off setting up a public AMI LAMP stack and have the freedom to configure your website however you'd like.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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