Last updated on November 6, 2023
This article will guide you on creating redirects on Amazon S3 for a website with a custom domain registered with Amazon Route 53. The following services will be used: Amazon Route 53 for domain registration and routing internet traffic, Amazon S3 for bucket creation, uploading a redirection script, configuring permissions for public access, and configuring the buckets for website hosting.
In this example, we will redirect a custom domain registered with Amazon Route 53 instead of using this lengthy URL. –
STEPS
Step 1: Go to Amazon S3 → Buckets → Create bucket
Follow the configurations below:
Follow this configuration:
Save changes.
Step 2: Note the Bucket website endpoint. We will use it on Amazon Route 53.
Step 3: Go to the Permissions tab → Bucket policy → Edit.
Paste the policy below:
Ensure to replace the current domain name with your domain name.
Save Changes.
Step 4: Create an HTML file using the provided HTML content below.
Replace the current URL with the URL you wish to redirect to.
In this example, we’re using the http-equiv
attribute with a “refresh” directive in a tag to redirect to the AWS Community Builder Directory, where my name is listed.
Step 5: Save the file and name it index.html.
Step 6: Upload the index.html file in Amazon S3.
Add files → Upload the created HTML file:
Click Upload.
Step 7: Go to Amazon Route 53 → Hosted Zones → Your domain → Create record.
Follow the configuration below.
- Ensure to replace the subdomain under the Record name.
- Enter the Bucket website endpoint that you copied in Step 3.
That’s it! Using cb.nestormayagmajr.com it will now redirect to this very lengthy URL. –