Forums

ASP

This topic is locked

Blocking site

Posted 10 May 2008 13:38:27
1
has voted
10 May 2008 13:38:27 phil C posted:
how can i block my site from other countries?

Sounds a bad thing to do i know but we produce unique products and donot sell outside the uk, our competetors in canada are stealing our designs and copying them.

Replies

Replied 10 May 2008 21:18:53
10 May 2008 21:18:53 Georgi Kralev replied:
Hi Phil,

You could check the IP addresses of the visitors of your site. To get the IP address you can try the following code:

ASP with Proxy detection
<%
ipaddress = Request.ServerVariables("HTTP_X_FORWARDED_FOR"
if ipaddress = "" then
ipaddress = Request.ServerVariables("REMOTE_ADDR"
end if
%>

Then filter the content if IP address is not into the IP address ranges of UK.
There are many sites in Internet where you can find IP address ranges for particular country.

Hope this helps,

Regards,


Georgi Kralev

Homepage: gdkralev.googlepages.com
Replied 12 May 2008 20:33:47
12 May 2008 20:33:47 phil C replied:
Thanks for your reply, have found a database of ip address as you suggested, this seems to work fine now. if the ip rnge comes from canada they are directed to google. thanks for the pointer.

phil

Reply to this topic