Question

Is there a standard way of routing IP addresses from certain ranges to a certain link and another range to another link?

I have a large percent of visitors coming from China, but I don't want to make that reason enough to route all traffic to Youku. Oppositely, I don't want to have a broken page element for people in China.

Currently there is a screenshot button that loads up a Javascript popup. Inside the popup is the video that is meant to load. I could run a script to detect the IP address and server the respective link, if there was a way to detect this.

Im wondering if others have solved this issue already, and if so, what method they used.

Thanks!

ps: For those who dont know, Youtube is blocked in China and Youku is one of China's equivalent video streaming sites.

Was it helpful?

Solution

There may be better ways than this, but an possibility would be to let the client load Youtube (or Youku) in an iFrame and then read the contents of it, if you can't get the page or you can catch some error, then you should get Youku.

That does also mean that when Youtube is down for maintenance for example your script would break.

IP routing may be better, but as far as I know there is not a perfect script for it.

You may want to check this: How do you detect a website visitors country

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top