Blogvaria

This page is brought to you by Blogvaria (http://blog.evaria.com).

To obtain more information, ask questions and interact please visit our website.

Back to Blogvaria landing page
Feedback
Subscribe
   
Blogvaria

 

The personal pages

Blocking unwanted visitors

TrackBack | Filed by Thomas under Programming | Post popularity 5%

Not to long ago some of my forms on evaria.com were abused (or at least somebody tried) to submit SPAM. In order to stop this I set up a simple rule in a few of my .htaccess files across the site.

In order for the “filter” to be effective you need to know from what IP(’s) you’re being targeted. This should be available in your server log or, if you are like me, in the admin notification mail received whenever someone is submitting one of your forms.

Below is an example from one of my .htaccess files, edit the IP’s to fit your needs:

order allow,deny
deny from 85.255.113
allow from all

ErrorDocument 403 http://www.example.com/403.html

You can add as many IP’s you want. From the example above I’m blocking all IP’s ranging from 85.255.113.0 to 85.255.113.255. These are all part of the “inhoster.com” network operating from the Ukraine. I might be blocking someone nice, but if so I’ve set up an info page (ErrorDocument 403) informing those (if any) about why and their options.

If you just want to give visitors coming from external websites a warning/info see my post about how to filter incoming links, but have in mind that this method can not be trusted in the same way as an IP block and should not be implemented if you depend on having the external client/site blocked.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • BlinkList
  • blogmarks
  • del.icio.us
  • De.lirio.us
  • digg
  • Furl
  • NewsVine
  • Netscape
  • Reddit
  • Spurl
  • SphereIt
  • Technorati
  • YahooMyWeb
  • DZone
  • feedmelinks
  • Linkter
  • Ma.gnolia
  • Slashdot
  • StumbleUpon
  • TailRank
  • co.mments

No comments yet.

Leave a Comment

Akismet has protected Blogvaria from 86,353 spam comments. Design by Evaria.com. Powered by WordPress.
Our beloved and trusted server has rendered 3.732 pages so far today, an amazing 4.328 pages yesterday
and even more astonishingly 169.449 pages since 30 November 2008 alone without dropping a byte nor a pixel.

Close
E-mail It