Click here to Skip to main content
15,905,028 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
i have a website in html.i want visitors only from usa & canada.
Others visitors needs to redirect to error page.

Suppose a visitor is from USA/CANADA lands on my website on url "http://www.ABC.com/xyz/pqr.html".then page should open properly. But if a visitos is other than USA/CANADA visits on same url then visitor need to redirect to "http://www.ABC.com/404.html".

i used to run ads on google adwords and my services are for us/canda only. but i used to get fraud clicks from my competitors(by proxy)or from other countries ip.
Posted
Updated 31-May-13 8:30am
v3
Comments
Sergey Alexandrovich Kryukov 31-May-13 14:26pm    
Aha, and also discriminate them by gender and skin color... :-)
—SA
Manfred Rudolf Bihy 31-May-13 16:58pm    
That is one Thing! ;)
What about all those USians and Canadians visiting OP's Website when being neither in the USA nor in Canadia. Hmmmmm
Sergey Alexandrovich Kryukov 31-May-13 18:23pm    
Oh, yes!
By the way, please see my comments below.
Discrimination cannot help anyone by definition, I do think so...
—SA
Sanjeev236 31-May-13 14:29pm    
Sorry Sergey,if i hurted you. but actually i used to run ads on google adwords and my services are for us/canda only. but i used to get fraud clicks from my competitors(by proxy)or from other countries ip.
Sergey Alexandrovich Kryukov 31-May-13 18:28pm    
No, you did not hurt me at all, but this is not a way to fight fraught or anything. How a discrimination can ever help anyone?

Well, suppose you deliver only to US and Canada and accept certain form of payment. If someone orders something and pays using proper payment system, what's the difference where this person is located in the moment of making an order? And so long, so forth... Just think about it.

And why do you think IP filtering can help you to prevent fraud? I'm afraid this is at least a bit naive... :-)

—SA

This is not a matter of javascript or html5. It is a server side concern. You need a GEOIP service to translate the client ip to geographic location and redirect if necessary. Checking IP ranges might be also a solution: http://www.proxyforest.com/e-allocate.htm[^]
 
Share this answer
 
If someone is really bent on hiding where they come from there is really nothing you can do about it. Don't believe me?
Read on here: https://www.torproject.org/[^].


Regards,

— Manfred
Refutance is systile, your a**es will be laminated!
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 31-May-13 18:30pm    
Great point, a 5.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900