Home > Net >  How do we host multiple HTML files in a single S3 bucket to get separate URLs for each file?
How do we host multiple HTML files in a single S3 bucket to get separate URLs for each file?

Time:02-11

I'm new to using AWS S3. I need to host my privacy policy HTML page and T&C HTML page in the S3 bucket as static web pages. I need separate URLs for those two files but I can not create separate S3 buckets for each file. So is there any way to full fill my requirement?

I need this kind of URLs after hosting the pages in the S3 bucket

http://<bucket-name>.s3-website-<AWS-region>.amazonaws.com/privacypolicy.html
http://<bucket-name>.s3-website-<AWS-region>.amazonaws.com/termsandcondition.html 

also, I can not create an index file for these HTML pages and after that link these HTML pages to that index file, because I need these URLs to link my mobile app. once the user clicks one of the links, the user should go to that page so that's why I need separate URL for these files.

CodePudding user response:

You dont have to create separate bucket

Just create 2 HTML files for example site1.html and site2.html. Here are the steps to follow

for example here is my link for site1.html http://stack-trial.s3-website.ap-south-1.amazonaws.com/

Note: you can also access the site1.html using this http://stack-trial.s3-website.ap-south-1.amazonaws.com/site1.html.

for site2.html http://stack-trial.s3-website.ap-south-1.amazonaws.com/site2.html

  • Related