No internet connection
  1. Home
  2. Support

How to add index.html to links?

By William Scott @vk2xxy2019-05-21 01:46:12.601Z2019-05-21 03:55:58.290Z

I've noticed that links (categories for example) point to a folder. This is fine if the host defaults to returning index.html.

I like to host with Lambda@EDGE >> Cloudfront >> S3 Bucket.

S3 buckets when accessed via their endpoint address will return index.html for subfolders.

When cached by Cloudfront, setting a custom endpoint for the S3 bucket will return index.html.

When cached by Cloudfront, setting a S3 endpoint from the drop down does not return index.html but gives an access denied error. This appears to be working by design according to AWS documentation.

So, is there a setting in WP2Static to append index.html to links?

EDIT:

https://aws.amazon.com/premiumsupport/knowledge-center/cloudfront-default-root-object-subdirectory/
  • 2 replies
  1. Leon Stafford @leonstafford2019-05-22 07:12:33.042Z

    When you setup the CloudFront distribution pointing to S3, you'll need to use the Static website endpoint URL for the origin, NOT the S3 bucket address that is offered in their drop-down.

    For both S3 and CF, you'll want to set the default document to index.html

    That should fix everything for you.

    Cheers,

    Leon

    1. VWilliam Scott @vk2xxy2019-05-22 09:41:47.898Z

      When you setup the CloudFront distribution pointing to S3, you'll need to use the Static website endpoint URL for the origin, NOT the S3 bucket address that is offered in their drop-down.

      I found the above solution while searching. However, there is talk that users can go straight to the endpoint URL and bypass cloudfront.

      My current solution is as per the AWS documentation and using Lambda@EDGE.

      However, if the ZIP output can append index.html maybe a checkbox to do the same with other deploy methods.