Open peterbe opened 5 years ago
I skimmed this post: https://forums.aws.amazon.com/thread.jspa?threadID=168000
The poster is, like us, very particular about remaining consistent with existing URLs and getting the redirects just right.
That poster figured out to get it to work, he/she created a "folder" called state
, and in it, a index.html
that redirects to /state
. And then he/she created a "file" called state
(yes, same name as the folder previously created) and made sure this file has ContentType: text/html
.
@escattone Do you know, is this something we have to worry about on the CloudFront side or it entirely an S3 website hosting problem?
Let's assume that the ideal URL suffix behavior to mimic how it's already working on MDN, which actually looks pretty neat. With one exception.
It's conceivable that a user might type all 3 of these:
DOMAIN/en-US/docs/Web/HTML/Element/video
DOMAIN/en-US/docs/Web/HTML/Element/video/
DOMAIN/en-US/docs/Web/HTML/Element/video/index.html
This is what MDN currently does:
DOMAIN/en-US/docs/Web/HTML/Element/video
--200
DOMAIN/en-US/docs/Web/HTML/Element/video/
--301
toDOMAIN/en-US/docs/Web/HTML/Element/video
DOMAIN/en-US/docs/Web/HTML/Element/video/index.html
--404
Since MDN is currently not a static site, it doesn't really make sense to support
index.html
but if we move towards static site hosting, it's inevitable that users will try to type it in and doing a redirect is possible if figured out once, will last for life.So, the desired end goal is:
DOMAIN/en-US/docs/Web/HTML/Element/video
--200
DOMAIN/en-US/docs/Web/HTML/Element/video/
--301
toDOMAIN/en-US/docs/Web/HTML/Element/video
DOMAIN/en-US/docs/Web/HTML/Element/video/index.html
--301
toDOMAIN/en-US/docs/Web/HTML/Element/video