Forum Moderators: phranque
ErrorDocument 403 /error403.php
RewriteCond %{HTTP_USER_AGENT} BadBot1 [NC,OR]
RewriteCond %{HTTP_USER_AGENT} BadBot2 [NC]
RewriteRule ^(.*)$ - [F,L] BrowserMatchNoCase BadBot1 stopthebot
Deny from env=stopthebot RewriteRule ^forbidden\.html - [L]Every mod that issues 403s needs a separate hole poked for it. The above version is for mod_rewrite. If you also use mod_authzthingummy, possibly in conjunction with mod_setenvif, then that exemption looks like this: <Files "forbidden.html">
Order Deny,Allow
Allow from all
</Files>
Note that here you use only the filename, not the full URL path as in mod_rewrite. Apache 2.4 will have different content, involving <Require>, but the same <Files> envelope.