I am curious if it is possible for me to set up a geo-ip identification, meaning if a visitor is from US, then when he/she visits my blog, it will be redirected to us.myblog.com (which is based on a US VPS) and then if he is visiting from Europe, it will be going to a server based in Europe (say eu.myblog.com). However if US is down for any reason, EU server would be taking up all the request.
The basic purpose of doing this is just to reduce loading time, both blogs will, hopefully, have the same contents if I can get the synchronization right.
Comodo's DNS service allows geo-based DNS records. Not a big fan of their panel, but it gets the job done.
Sajan Parikh - PHP Development | Server Management | Linux Administration | Web Consulting Feel free to get in touch with me if I can be of assistance with anything.
e: [email protected] | w: sajan.io
Give me a call at (563) 447-0995.
@EDIS: Thanks for your suggestion, I will give it a try!
They have some limitations though, no GeoIP on the Maindomain - just Subdomains.
So you need to create a cname from yourdomain.com to redirect.yourdomain.com (which is then a "smart subdomain" how they call it) and add the US A record to us.yourdomain.com, EU A record to eu.yourdomain.com.
Then when a user loads youdomain.com he gets first redirected to redirect.yourdomain.com which then sees if he is EU or US, and then redirects him to (eu|us).yourdomain.com
The PHPlike script for the redirect is pretty simple at all but a mess to write it first as you need to list all countrys you want in the countrycode format i.e. (PSEUDOCODE DO NOT USE):
$us_countrys = us mx ca pa
$eu_countrys = uk de at se
if $country IS IN $eu_countrys DO $output = $euserver
else if $country IS IN $us_countrys DO $output = $usserver
else $output = $usserver
@EDIS: I am not a PHP programmer so I guess I won't bother to try the PhP solution, I think the redirection trick will work well and that is what I shall start playing around with. Thanks so much for your detailed explaination!
@EDIS: I guess I did not interpreted what you meant properly, just set up an account with them, and it turns out I still need to do quite a bit of serious PHP coding to set things up haha. Thanks a lot anyways!