![]() |
|
#1
|
||||
|
||||
Blocking Spambots by .htaccessWhen SPAMBots come to your website, they are coming for e-mail addresses so they can later spam those e-mail accounts. A simply way to correct this is to block them from your site. Here is a sample way to do this.
All code goes into the .htaccess file in the public_html directory. Blocking by referrer Code:
A bit of explanation: The ^ character stipulates that the referrer string must begin with the text that follows it. The (www\.)? part means that the rule is true whether or not the www is present in the referrer string. (ie. It will catch http://banned.com and http://www.banned.com) Note that [OR] is placed at the end of each line except the last one. Sometimes the referer is fine, however, the bot still comes. Here is a way to ban bots by user agent. Code:
What would be nice now is to research where each bot actually comes from, and then have the robot go their and collect the info their and have them spam their own servers. Anyone know of any cons in doing this? __________________
Mr. Bob's Web Design - Tirelessly looking for ways to enhance the customer base of your business. |
|
#2
|
||||
|
||||
|
I've seen a bot script once.. it was small and only visited pages (like google) and didn't look for email addresses.
but the thing I saw there was that they just put a common used browser as User Agent. That means that it's really hard to find those bots, they just look like normal visitors.. and the whois pages check is also not going to work for most bots.. they can just get that information from a lot of servers around the world, if one gets blocked they just use another. But I must say that the idea to stop but by redirecting them to another place is great |
|
#3
|
|||
|
|||
|
Quote:
I suggest changing your rewrite rule to just generate a 403 error: Code:
|
Recent GIDBlog
Last Week of IA Training by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| .htaccess on Windows2k, and the trailing slash | Pedster2k | Apache Web Server Forum | 6 | 24-Jan-2004 17:32 |
| Overriding .htaccess | toadatrix | Apache Web Server Forum | 2 | 02-Jan-2004 22:00 |
| .htaccess language / rewrite problem | spinflip | Apache Web Server Forum | 5 | 15-Dec-2003 14:14 |
| .htaccess - allow IP addresses- how to? | dadpups | Apache Web Server Forum | 3 | 18-Nov-2003 09:01 |
| Problem with .htaccess | Zergus | Apache Web Server Forum | 7 | 29-Jul-2003 11:01 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The