1. Hosting on AWS S3
- Create an S3 Bucket: Go to AWS S3 and create a bucket. Make sure the bucket name is globally unique.
- Enable Static Website Hosting: In the bucket properties, enable "Static website hosting" and set
index.htmlas the index document. - Upload Your HTML File: Upload your HTML file (like this page) to the bucket.
- Set Permissions: Add a bucket policy to allow public read access:
{ "Version": "2012-10-17", "Statement": [ { "Sid": "PublicReadGetObject", "Effect": "Allow", "Principal": "*", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::your-bucket-name/*" } ] } - Access Your Website: Use the endpoint in the S3 bucket static website hosting settings.
Optional: Use Route 53 to connect a custom domain.
2. Hosting on GitHub Pages
- Create a GitHub Repository: Go to GitHub and create a new repository. Initialize it with a README if you like.
- Add Your HTML File: Upload your
index.htmlfile to the repository. - Enable GitHub Pages:
- Go to Settings → Pages.
- Select the branch (usually
main) and root folder as the source. - Click Save. GitHub will provide a public URL for your website.
- Visit Your Website: Use the provided URL to see your live site.
- Optional Custom Domain: You can add a custom domain in the GitHub Pages settings using a CNAME record.