I am trying to figure out if it is possible to purchase one "master" domain but make its sole purpose to redirect and fork visitors to country specific external domains. Sounds confusing, but here is an example of what I mean:

I buy domain ABCXYZ.com, if someone from USA visits this "master" domain, it redirects them to abcxzy.shopify.com. If someone from Canada visits the master domain then they are redirected to randomcanadasite.com.

Everything I could find only talks about using subdomains so having us.abcxyz.com and ca.abcxyz.com.

I know there are also CDNs but my understanding is that they only show the content you host on a single domain.

Basically I am trying to find a way to buy one domain and have geo-location filtered traffic be redirected to "unrelated" domains. How can I do this?

  • You would need to redirect visitors using a Geolocation database based on IP address (aka, a GeoIP database) for each country you intended on targeting. This can be done via server-side scripting or using a JavaScript API (see this for code examples). First you need to identify the country based on the IP lookup, then you can redirect the visitor to whatever domain you chose. As to how to code this, unfortunately coding is considered off-topic here and would really depend on what language you'd like to use. – dan Mar 24 '19 at 6:08
  • How would anybody ever know to visit this domain to get redirected? In the case of sub-domains, you need something for when people take the sub-domain off of their country site. However, a master domain cannot be derived from other domain sites. – Stephen Ostermiller Mar 24 '19 at 10:06

Redirecting based on location can be error-prone and is considered user-unfriendly in most cases, but if that's what you want to do:

  1. Set up some type of web server (nginx, apache, etc.).
  2. On that web server, implement redirects to other domains (whether it's an entirely different domain or a subdomain doesn't matter) based on geo-location. You'd have to somehow get permission from the user to access their location before sending them to the redirection domain.

  3. Point your domain name to that web server with a new "A Record."

Just know that if users haven't been to the site before and you're asking permission to see their location before redirecting them, that'll undoubtedly reduce the amount of traffic your site receives.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.