开发者

Mod_rewrite on Amazon S3

Is it possible to use mod_rewrite on Amazon S3?

www.example.com/about.html -> mybucket.s3.amazon.com/index.html
www.开发者_JS百科example.com/welcome.html -> mybucket.s3.amazon.com/index.html
www.example.com/contact.html -> mybucket.s3.amazon.com/index.html

Thanks!


In this case you can use Error Document.

Mod_rewrite on Amazon S3


The error document solution works on the surface, but if you check the actual response status header you'll see the page comes back as a 404. This is obviously not good.

I'm still looking for alternatives, for now I think I'll resort to using hashbangs.


No.

But you can host it under a different sub-domain. eg You can have

s.example.com/about.html 
s.example.com/welcome.html 
s.example.com/contact.html

and serve them directly from it. Better still is serving these files in cloudfront. Here is how you get your own subdomain in cloudfront.

One question to you is. All these files are mostly static, not performance heavy and rarely visited. Hosting them in CDN looks bit overkill.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜