You get a bonus - 1 coin for daily activity. Now you have 1 coin

.htaccess - blocking site access from certain User-Agents (web browsers or bots)

Practice



Here's a snippet of an .htaccess file that blocks several User-Agents (web browsers; actually bots, really).

SetEnvIfNoCase User-Agent "^Titan" bad_bot
SetEnvIfNoCase User-Agent "^Wget" bad_bot
SetEnvIfNoCase User-Agent "^SiteSnagger" bad_bot
SetEnvIfNoCase User-Agent "^WebAuto" bad_bot
SetEnvIfNoCase User-Agent "^NetAnts" bad_bot
SetEnvIfNoCase User-Agent "^WebZip/4.0" bad_bot
SetEnvIfNoCase User-Agent "^httplib" bad_bot

<Limit get="" post="" head="">
Order Allow,Deny
Allow from all
Deny from env=bad_bot
</Limit>


The list of "bad" User-Agents here is very small and is given only as an example.

Applies to: Apache 2.x

Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "Running server side scripts using PHP as an example (LAMP)"

Terms: Running server side scripts using PHP as an example (LAMP)