Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Domain redirection based on Geo - AWS

I have basically 2 hosted zones **.com and **.co.in. For all the incoming traffic from India , if user browses .com it should automatically redirect to co.in . How do we do this in AWS . I read this http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resource-record-sets-values-geo.html#rrsets-values-geo-location and implemented in co.in hosted zone but does not seem to work. Also I think there should be some domain redirection set up in .com but cant find where we can do in Route53

Regards Raghav

like image 898
Raghav Thakur Avatar asked Aug 31 '25 06:08

Raghav Thakur


1 Answers

To simplify my solution, I'm going to refer to these domains as example.com and example.co.in. Here's how I'd solve this:

S3 Bucket for example.com:

Static Website Hosting:
  Redirect Requests:
    Target Bucket or Domain: example.co.in

Note the region that this bucket is created in, such as us-east-1, we'll need that later

Route 53 Record Set for example.com For India:

Type: CNAME
Value: example.co.in.s3-static-website-[region].amazonaws.com
Routing Policy: Geolocation
  Location: India
  Set ID: India Redirect

Route 53 Record Set for example.com Not India:

You'd set your Type and Value as normal

Routing Policy: Geolocation
  Location: Default
  Set ID: Regular Traffic

Further Reading:

  • Geolocation Resource Record Sets
  • How Do I Redirect Requests to an S3 Bucket Hosted Website to Another Host?
like image 141
Jamie Starke Avatar answered Sep 03 '25 03:09

Jamie Starke