Slashdot Mirror


How To Keep a Web Site Local?

Cornwallis writes "The universal accessibility of the Internet is one of its attractions. But what do you do when you don't want your board to be Slashdotted? Back in the day it was great to run a local BBS where friends and neighbors could dial in using their 9600-baud modems to pick up mail or share games or stories. Now, my Web-based board gets slammed by people from all over the world who have no reason to access it, can't possibly take advantage of the locally focused services it offers, and generally take up my time because I have to block their accounts or explain to them why they can't have access. This despite the fact that the board explains quite clearly that it is for local use only and couldn't possibly be of interest to them. Other than putting thousands of entries in my hosts file to block IP ranges, what options do I have to restrict access to locals only? Or isn't that feasible?"

22 of 297 comments (clear)

  1. .htaccess by Norsefire · · Score: 5, Informative

    order allow,deny
    deny from all
    allow from iprange
    allow from iprange
    allow from iprange
    etc. etc.

    There are websites all over the internet that allow you to do country-by-IP-range lookups.

    You could also do;

    ErrorDocument 403 "Sorry, this website is only available to people living in .

    (Yes, no final quotation mark).

    Or don't worry, what does it hurt if people who aren't benefiting from a website visit it?

    1. Re:.htaccess by Anonymous Coward · · Score: 5, Funny

      ErrorDocument 403 "Sorry, this website is only available to people living in .

      Or "This is a local website for local people. There's nothing for you here."

      Or don't worry, what does it hurt if people who aren't benefiting from a website visit it?

      They covet the precious things.

    2. Re:.htaccess by fractoid · · Score: 4, Funny

      Or "This is a local website for local people. There's nothing for you here."

      Thankyou! I was hoping someone would say this. ;) Bad login attempts should lead to an error page saying "What's all this shouting? We'll have no trouble here!"

      --
      Rampant carbon sequestration destroyed the Dinosaurs' tropical paradise. I'm here to help repair the damage.
    3. Re:.htaccess by Anonymous Coward · · Score: 5, Informative

      For any Americans wondering what their mad cousins, from across the pond, are talking about: http://www.youtube.com/watch?v=zOGAAlHzF4o

    4. Re:.htaccess by andy.ruddock · · Score: 5, Informative

      Or allow access to all registered users, but only allow "local" access to the signup page.

      --
      God: An invisible friend for grown-ups.
    5. Re:.htaccess by JWSmythe · · Score: 4, Funny

      I'm on the 10.0.0.0 network, you insensitive clod! :)

      --
      Serious? Seriousness is well above my pay grade.
    6. Re:.htaccess by jsiren · · Score: 4, Funny

      iptables -A INPUT -s ! 127.0.0.0/8 -j DROP

      That should keep those pesky non-locals out. ;)

      There, fixed that for you.

      --
      Usage: km/h for speed (kilometers per hour); kph for very slow impulses (kilopond hours).
  2. Good question, but... by Anonymous Coward · · Score: 5, Funny

    ...I doubt Slashdot can make a good assessment without taking a look at the site. Mind posting the URL?

    1. Re:Good question, but... by MichaelSmith · · Score: 4, Funny

      I'll ask 4chan to help. Looks like a big job.

  3. Re:Why use a tech solution? by jschen · · Score: 4, Insightful

    I agree that this probably should not be solved purely on the technology end of things. One of the great things about the Internet is that one can access things from most anywhere. Your website may cater to locals, but you need to consider the possibility that someone who is generally local to the area but currently elsewhere might want to access the site. That's a pretty serious problem for filtering based on geography.

  4. Why you gotta be like that? by QuantumG · · Score: 5, Interesting

    You have no idea what is of use to other people. Maybe they're thinking of visiting your local area. Maybe they have friends that live there. Maybe they're thinking of setting up a similar board for their own area and want to know how yours is going. Put down your ego for a minute.

    --
    How we know is more important than what we know.
  5. local knowedge by 1u3hr · · Score: 5, Insightful
    We have a forum for our village.

    A couple of years ago we started to get a lot of people signing up from China, India, Russia etc and then posting spam. So now, to register with the forum you have to answer a question that requires you have some local knowledge. That gets rid of most automatic signups. And secondly, the accounts are not activated automatically but have to be approved by an administrator. So we delete those with spammy URLs in their signatures ("Buy WOW gold" seems to be a common variety). In a small community, the number of real local people siging up is a few per week. Maybe a couple of spammers get past that in a month, and then their posts and accounts are quickly deleted.

  6. Re:Easier option by X0563511 · · Score: 4, Insightful

    Best to only apply this restriction to account creation. Requiring them to be local when they make the account is entirely understandable, but blocking them from logging in while traveling is not.

    --
    For large sets, this will be our guide even unto death, for the LORD will work for each type of data it is applied to...
  7. You can automate it by an.echte.trilingue · · Score: 4, Informative

    While it does involve having thousands of addresses, this kind of thing is pretty easy to automate, given what your goals are. For example, I use this tool to determine which country my visitors are in and display the relevant contact information (show the French address to people in France, the Belgian one to people in Belgium, etc). I have a cron job set up to update the database once a week; it is fully automatic and very reliable.

    If you need to be more specific, this guy has a php class that can supposedly give you information as specific as city, or you can write your own using the db you can download here, although I can't personally vouch for either. You could also parse the hostnames in your server and only allow service providers in your area.

    Also, google code has a really good tutorial for a client side application if your server is limited in its capabilities.

    Either way, it sounds from the summary like you have access to a database of ip address ranges you want to allow. Just set up a cron job to download it and parse it.

    --
    weirdest thing I ever saw: scientology advertising on slashdot.
  8. Re:Who are locals? by Z00L00K · · Score: 4, Informative

    Have a credibility check page - like checking if someone knows about a local detail that's known by the locals.

    "What was the color of the church at Elm Street before 2004?"

    And you may want to be careful with IP address filtering since that can result in unexpected disadvantages when a local is out traveling.

    --
    If builders built buildings the way programmers wrote programs, then the first woodpecker would destroy civilization.
  9. Re:Why use a tech solution? by Jurily · · Score: 5, Insightful

    That's a pretty serious problem for filtering based on geography.

    No kidding. Basically, anyone who thinks geography-based filtering is a good idea should be shot. Imagine moving 2000 miles, then being told by some braindead webdesigner you can't talk to your friends anymore.

  10. Re:Hmmm.... by davmoo · · Score: 4, Insightful

    And it sounds like you've never had to pay for things like bandwidth and server space out of your own pocket. Maybe he wants to keep it small because that's what he can afford. Information may want to be free, but the infrastructure to host it never is.

    --
    I want a new quote. One that won't spill. One that don't cost too much. Or come in a pill.
  11. Re:People travel. by azaris · · Score: 5, Funny

    Don't expect that your users stay in one place. Do expect that they sometimes travel to other countries.

    I was going to suggest this, then realized his users are likely to be Americans.

  12. Re:Why use a tech solution? by 1u3hr · · Score: 5, Interesting
    No kidding. Basically, anyone who thinks geography-based filtering is a good idea should be shot. Imagine moving 2000 miles, then being told by some braindead webdesigner you can't talk to your friends anymore.

    Happens to me a lot. I'm in Hong Kong. I find some US ISPs (like AOL) bounce my mail solely based on my location. And much media (even some on Youtube) is blocked geographically. Even some porn sites block me.... And other sites insist on giving me Chinese versions of their web pages, with no option to choose English. Highly irritating to go to Google.com and find myself redirected to Google.com.hk. (Yes, I have workarounds now, still annoying.)

  13. A few issues by Canazza · · Score: 4, Informative

    Your local audience may leave the area (either on holiday or to live) but still want to talk to people back home. This means that blanket IP Range blocking is out of the question.
    What I suggest is restrict viewing the website to people who are logged in. A default splash page for those not logged in could be shown that's minimal in graphics and text, containing just the log-in form and a 'register here'.

    To stop unwanted people registering a new account, you could to a blanket IP ban on the registration page ONLY, meaning that a local person can register at home, and then roam to wherever and still access the site.

    someone mentioned earlier this library for blocking a range of IP's by country and this PHP class that can do it too.
    Just use them on the registration page and set up a redirect for those who are not logged in (regardless of location) and you should have a nice walled in forum.

    --
    It pays to be obvious, especially if you have a reputation for being subtle.
  14. Information wants to be free by Anonymous Coward · · Score: 5, Funny
    Copyright doesn't exist. You don't have the rights to keep your information for yourself. You MUST share it with all us and everybody as the rights to copy and use it.

    or so I have been told here on slashdot.

    PS. Apple users suck.

  15. Re:Easier option by Anonymous Coward · · Score: 5, Funny

    Best to only apply this restriction to account evolution.

    Fixed that for y... wait, what?