Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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
add comment

2 Answers

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
1  
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
add comment

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
add comment

Your Answer

 
discard

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.