So I was stuck in a situation where I had to redirect a domain name to another. I was looking for a quick and handy solution and this trick helped me to achieve it.
Here are the quick steps.
- Domain name to Route 53.
![](https://i0.wp.com/miro.medium.com/v2/resize:fit:875/1*hBrbngCVVtBRmat4RI1Zcw.png?w=640&ssl=1)
2. Create a new bucket with the same domain name
![](https://i0.wp.com/miro.medium.com/v2/resize:fit:875/1*4BatfPRM8T2iS_3T6bD75A.png?w=640&ssl=1)
3. Enable Static hosting of the website
![](https://i0.wp.com/miro.medium.com/v2/resize:fit:875/1*m1ZRhBuGX16HyjP4gIWU7Q.png?w=640&ssl=1)
4. Add the URL after selecting “Redirect requests for an Object”
![](https://i0.wp.com/miro.medium.com/v2/resize:fit:875/1*5hO_-c2OarRe0RAs8TcZFw.png?w=640&ssl=1)
5. In Route 53 — Add an “A” record, enable Alias
![](https://i0.wp.com/miro.medium.com/v2/resize:fit:875/1*Zj7ges2MhY5c-UrBSnACMg.png?w=640&ssl=1)
![](https://i0.wp.com/miro.medium.com/v2/resize:fit:875/1*o7-OJAQyFI-JR9EiRW5D5g.png?w=640&ssl=1)
That’s it.
You can test it with the curl command
curl -i -s s.in | grep -E "HTTP|Location"
HTTP/1.1 301 Moved Permanently
Location: http://www.s.com/