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.
2. Create a new bucket with the same domain name
3. Enable Static hosting of the website
4. Add the URL after selecting “Redirect requests for an Object”
5. In Route 53 — Add an “A” record, enable Alias
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/