Redirect Domain to Another Domain Using AWS Route 53

In this blog post, I will show you how I redirect a domain hosted on AWS route 53 to another domain.

Get Started

This process can be done on a few levels:

  • DNS level
  • Server level
  • Website level

The issue with the last two options is that they taking processing power from the server.

When using DNS level routing the requests are not hitting the server and AWS handles the process.

In this process, I will need to create an S3 bucket for web hosting with redirection.

The process might sound complicated but it is not.

Process

In this process, I will redirect www.deploycontainers.com to www.ntweekly.com

Create S3 Bucket

The first step will be creating an S3 bucket with the name of www.deploycontainer.com

S3 buckets 
Q Search tor buckets 
+ Create bucket 
Bucket name 
Edit public access settings 
Empty 
Delete
Name and region 
Bucket name 
deploycontainers.com 
Region 
Asia Pacific (Sydney)

After the bucket is ready, I will click on it and open the Properties page.

I will enable Static web hosting and select the redirection option.

Properties 
rsormng 
rsions ot an object in the 
me bucket 
am more 
Permissions 
Management 
Access points 
Server access logging 
Set up access log records that provide 
details about access requests. 
Leam more 
Disabled 
Static website hosting 
Host a static website, which does not 
require server-side technologies. 
Learn more 
Disabled

In the redirection option, I will select Redirect requests.

I will type www.ntweekly.com under the target bucket or domain.

The protocol will be http.

Note: https redirection is not supported.

Static website hosting 
Endpoint http://wmv_deploycontainerscom_s3-website-ap-soutneast- 
2.amazonaws.com 
O 
IJse this bucket to host a websiteO Learn more 
Redirect requests O Leam more 
Target bucket or domain 
www_ ntweekly.com 
Protocol 
http 
O 
Disable website hosting 
Disabled 
Cancel 
Save

Route 53 Configuration

Now, I will head over to the Route 53, www.deploycontainers.com Zone and change or create a new A record for www.

Below, you can see the configuration.

Name = www

Alias = yes

Alias Target = the S3 bucket with the name www.deploycontainers.com

Note: If your bucket name is not the same as the domain or it is taken you will need to use a server-level redirection.

Create Record Set 
Name: 
Type: 
_deploycontainers.com_ 
A — IPv4 address 
Alias: @ Yes 
Alias Target: 
You can also type 
- CloudFront di 
- Elastic Beansta 
- ELB load balan 
- S3 website end 
- Resource reco 
- VPC endpoint: 
- API Gateway cu 
2 amazonawsz 
- Global Accele 
Learn More 
No 
Enter target name 
S3 website endpoints 
mwzdeploycontainers.com (s3-website-a'H 
ELE Application load balancers — 
No Targets Available 
— ELE Classic load balancers — 
No Targets Available 
ELE Network load balancers — 
No Targets Available 
Routing Policy: Simple 
Route 53 responds to queries based only on the values in this record Learn 
More 
Evaluate Target Health: 
O Yes 
@ No

Click create and you are done.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.