views:

1291

answers:

8

Is there a way to make S3 default to an index.html page? E.g.: My bucket object listing:

/index.html
/favicon.ico
/images/logo.gif

A call to www.mysite.com/index.html works great! But if one were to call www.mysite.com/ we'd either get a 403 or a REST object listing XML document depending on how bucket-level ACL was configured.

So, the question: Is there a way to have index.html functionallity with content hosted on S3?

I'm kinda thinking there isn't :(

A: 

I don't think there is.

John Boker
+3  A: 

I would suggest reading this thread from 2006 (On Amazon web services developers connection). It seems there's no easy solution to this.

yoavf
A: 

you probably need Akamai

Jakub Šturc
+1  A: 

The AWS Developer Connection answer, in brief, seems to maybe later.

Since S3 is more of a HTTP-based API (REST, SOAP) web-service (and less of a site-hosting service), there are technical API backward compatibility issues to be dealt with.

Ho, humm. It would have been convenient.

And Akamai? No way, they are crazy expensive!

Stu Thompson
+2  A: 

Unfortunately there is no easy way to have S3 automatically return the index.html file, or any other, when someone accesses the root location in your bucket.

As a work-around, the best option is to run a real web server to handle this kind of thing (redirects, custom 404s, directory listings etc) and serve only your static or large files from S3. The service simply isn't designed to replace a proper web server.

James Murty
+1  A: 

Short answer no. However you may want to look at setting up a proxy, such as Shrub Shrub / Amazon S3 Proxy

Ralph Shillington
A: 

you can do it using dns webforwards and cloaking. just forward to the complete path of the index.html

www.example.com forwards to http://www.example.com.s3.amazonaws.com and make sure you cloak the output.

nick
+1  A: 

Yes. using AWS Cloudfront lets you assign a default file.

Amaroom