homepage Welcome to WebmasterWorld Guest from 54.237.38.30
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

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

5+ Year Member



 
Msg#: 4369890 posted 10:24 pm on Oct 2, 2011 (gmt 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?

 

Leosghost

WebmasterWorld Senior Member leosghost us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4369890 posted 11:07 pm on Oct 2, 2011 (gmt 0)

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 :)

lucy24

WebmasterWorld Senior Member lucy24 us a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



 
Msg#: 4369890 posted 11:26 pm on Oct 2, 2011 (gmt 0)

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 ::

g1smd

WebmasterWorld Senior Member g1smd us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4369890 posted 11:37 pm on Oct 2, 2011 (gmt 0)

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

If so, it was #1 in Google for [deny competitor g1smd]. :)

Asia_Expat

5+ Year Member



 
Msg#: 4369890 posted 2:47 am on Oct 5, 2011 (gmt 0)

Thanks, that gives me some stuff to work with.

Is blocking Greece (and possibly Spain) altogether, likely to cause me ranking/indexing issues?

g1smd

WebmasterWorld Senior Member g1smd us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4369890 posted 8:04 am on Oct 9, 2011 (gmt 0)

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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved