S3 static pages without .html extension

In general on Amazon S3, to create clean URLs you can:

  1. Upload the page file with a "clean" name, e.g. mypage and set the Content-Type set to text/html (as the post you linked to described). You must rename the file on your system before you upload it to have no extension, or rename it without the extension on S3 after uploading. The file's name on S3 must not have an extension.

  2. Create a folder with the "clean" name and upload the page file to that folder with its name set to the default index document, e.g. index.html. You need to check what the default index document name is. This is set when you configure your bucket as a website, but can be changed later.

If you can't make the above work you can upload a new zero-byte object with the name key mypage and then set a page redirect by specifying the Website Redirect Location key with a value mypage.html in the metadata during the upload process. See Configuring a Web Page Redirect in the Amazon S3 documentation.

You could also copy the file to a new object named mypage with Content-Type set to text/html.


As some have said already, delete the file extension, but then simply follow the following steps:

  1. Go to your Amazon S3 bucket.
  2. Select the checkbox next to the file you'd like to have linking properly.
  3. Click "Properties" on the right, and a new pane will show up. It'll say "Object: filename"
  4. Click the Metadata tab, change from default, which for me was "binary/octet-stream"; new value should be "text/html".
  5. Save.

And as people have said, make sure your new links in your html don't contain the .html file extension anymore. This worked for me.


I just had this problem and I'd like to share the solution:

You have to set the meta data of the file Content-type to text/html AND rename the file removing the .html of the end.

That way you will be able to reach every page without the file extension.