Home > Enterprise >  How to setup Cloudfront & S3 to point to index.html for every route?
How to setup Cloudfront & S3 to point to index.html for every route?

Time:10-30

I have a NextJS application hosted on AWS. My folder structure is like this:

- index.html

- /articles
-- index.html

-- /article1
---- /index.html

-- /article2
---- /index.html
.
.
.

How do I set the routing to that /articles points to /articles/index.html, /article1 points to /article1/index.html and so on. Every folder in my app has a corresponding /index.html. I have hosted my side on S3 and I am using cloudfront. I have already tried setting the default root object to /index.html but it looks like it only sets it for the root/domain, not the subfolders.

Thanks.

CodePudding user response:

You will probably need a enter image description here

  • Related