Welcome to WebmasterWorld Guest from 54.147.50.227

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Deny Greece, and show them a tailor made 'go away' page

     
10:24 pm on Oct 2, 2011 (gmt 0)

Preferred Member

10+ Year Member

joined:Dec 7, 2005
posts:636
votes: 0


Long story short. I have an unwelcome guest on my site (family member, complete nutter, stalker, psycho etc etc), and the only way to be sure that person can't access my site is to block their country. I only get four or five visitors per day from that country, so it's no great loss. She's also too stupid to know about VPN, or how to use it.

I want to use CIDR notation downloaded from countryipblocks, or similar. I've found lots of tutorials on blocking, but can't figure out how to display a special page for that country (I'll add a 403 header in PHP at the top of the page). I want to create a bespoke page for that particular country.

Whatever I use, I'll drop it into my httpd.conf file for resource efficiency.

Any tips or pointers?
11:07 pm on Oct 2, 2011 (gmt 0)

Senior Member from FR 

WebmasterWorld Senior Member leosghost is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Feb 15, 2004
posts:6717
votes: 230


We had a similar problem a few months back here... for someone who wanted to show a different page to their competitor... if g1smd can find the thread via WebmasterWorld search* ( he'll be a better man than I Gungadin .."clue" he is ;-) ..between us ..we gave the script and the IP tables base( IIRC re the IP tables base )- ( the only really accurate IP country tables are paid, unfortunately for you..look for "maxmind" ) ..that thread will give you what you need via php "switch" and redirect...you may also want to include something against proxies via xheaders if the person is being really difficult and knows how to use proxies...

*I can never get search here to work .. it is offline whenever I try...anyway HTH :)
11:26 pm on Oct 2, 2011 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
posts:13218
votes: 348


Can't you just do it with mod_rewrite? Set your assorted IP ranges as conditions (pipe-separated if you can, OR if you must), redirect to the named page and there you are.

:: twiddling thumbs idly ::
11:37 pm on Oct 2, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:July 3, 2002
posts:18903
votes: 0


Was it this one? [webmasterworld.com...]

If so, it was #1 in Google for [deny competitor g1smd]. :)
2:47 am on Oct 5, 2011 (gmt 0)

Preferred Member

10+ Year Member

joined:Dec 7, 2005
posts:636
votes: 0


Thanks, that gives me some stuff to work with.

Is blocking Greece (and possibly Spain) altogether, likely to cause me ranking/indexing issues?
8:04 am on Oct 9, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:July 3, 2002
posts:18903
votes: 0


Any searchengine that crawls with IPs from those countries will delist you.