Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I understand it is possible to block a country from viewing my website using apache, .htaccess.

I was wondering if it is possible to block everyone from a specific City (namely the city of Flower Mound, in Texas) from accessing my website. If that's a no-go, how about blocking all of Texas?

Edit - the reason why. There is a competitor company that is based in Flower Mound. I want them to think my website is down/offline. cough dirty..i know

2nd Edit - I do this because they tend to steal my work, change it in some way, and then call it their own. They are quite adept in doing this, and I can't call upon the law for help.

share|improve this question

closed as off topic by GregD, Iain, Chopper3 Dec 10 '10 at 13:41

Questions on Server Fault are expected to relate to server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

I'd love to know why! – Rich Dec 10 '10 at 13:04
+1 for why. this sounds like a great story. – Sirex Dec 10 '10 at 13:05
What has Flower Mound done to you ? – Iain Dec 10 '10 at 13:05
But think of the children! – GregD Dec 10 '10 at 13:05
On a personal note, if I knew what your company was in the business of doing, knowing what you've asked here, I would not purchase a damn thing from you. – GregD Dec 10 '10 at 13:30

It's technically not possible to block 100% of all users in $CITY/$STATE/$COUNTRY . Reasons:

  • Proxy servers
  • Satellite connections
  • Inaccurate/too-infrequently updated geolocation databases

How about finding out which ISP your competitor uses and then block an IP-range of that ISP used in the city?

If you want to try blocking the city nonetheless, take a look at mod_security +GeoIP (assuming you're using Apache).

Funny question/idea btw ;-)

share|improve this answer
Any tip on how I can find out what ISP they use? I personally live in Canada, but I can get someone from Flower Mound to enter their company headquarters with a wireless laptop, if that helps any... – Greatestswordsman Dec 10 '10 at 13:20
Well I don't want to support illegal actions, but here are some keywords: WHOIS lookup, netcraft, DNS queries (dig, nslookup) etc. – weeheavy Dec 10 '10 at 13:25
... or just email them and start by the mail headers of the reply. – Sirex Dec 10 '10 at 15:40

Not the answer you're looking for? Browse other questions tagged or ask your own question.