At 5:16 PM +1200 6/7/02, Jean-Francois Pirus wrote:
used in New Zealand. My ultimate goal is to check users visiting a website to see if they are connected to the internet within New Zealand and redirect them to different pages accordingly, much like Google seems to be able to do these days, ie when I enter www.google.com, I end up at www.google.co.nz, and I'm assuming that this is done based on the IP address of the machine I'm on...??..
The way most people do it is by doing a reverse-dns lookup on the ip address of the client and looking for .nz at the end (for example) it will work most of the time.
I have a php script that does that if you are interested.
If you're using Apache, you can do it easily (and much faster) with mod_rewrite (usually within your <virtualhost> container)... RewriteEngine On RewriteLogLevel 0 RewriteCond %{REMOTE_HOST} .*nz$ RewriteRule ^/index.html$ /indexnz.html [L]
Probably, the only other way would be to get the AS numbers of all the local ISP and then find out the address ranges they use, but of course those keeps changing.
Messy, if not extremely frustrating. -- Andrew P. Gardner barcelona.com stolen, stmoritz.com stays. What's uniform about the UDRP? We could ask ICANN to send WIPO a clue, but do they have any to spare? Get active: http://www.tldlobby.com - To unsubscribe from nznog, send email to majordomo(a)list.waikato.ac.nz where the body of your message reads: unsubscribe nznog