When serving a static site off from Amazon S3, I'm wondering how to get rid of the .html file extensions for each page.
I am getting an error for
mysite.com/mypage
404 Not Found
Code: NoSuchKey
Message: The specified key does not exist.
Key: mypage
RequestId: 1089D7A26EFED9AD
HostId: Ud8cFy8Zl1mJ+oFjFOmU1Xacq9+v70KuaJfOc4nFMEPhd66AkLhr4Pj5u0QH6Gog
In serving a static site off of Amazon S3, I'm wondering how to get rid of the .html
file extensions for each page.
Right now I have:
mysite.com/ # works fine, serves index.html
mysite.com/mypage.html # works fine
mysite.com/mypage # doesn't work
The error for /mypage
shows:
404 Not Found
Code: NoSuchKey
Message: The specified key does not exist.
Key: mypage
RequestId: 1089D7A26EFED9AD
HostId: Ud8cFy8Zl1mJ+oFjFOmU1Xacq9+v70KuaJfOc4nFMEPhd66AkLhr4Pj5u0QH6Gog
I have tried setting the Content-Type
to text/htm
but it doesn't fix the problem for me.
How do I get /mypage
to serve the file at /mypage.html
on S3?