Using my incredible powers of cut & paste, I implemented Key_Master's trap.pl [webmasterworld.com] this evening. I had an existing .htaccess which I replaced with his, but I'd like to re-integrate the functionality of my old .htaccess back in. This is the old content:
RewriteEngine on
RewriteCond %{HTTP_REFERER}!^http://.*myurl.com [NC]
RewriteRule .*\.(gif¦GIF¦jpg¦JPG)$ - [F]
Can someone help?
RewriteRule [httpd.apache.org] \.(gif¦jpe?g)$ - [F,NC]
And you do not need the .* since it does not add any constraints on your match and is not needed for backreferences.
Andreas
You might be. (Or I just might be confused.) To clarify, Key_Master said:
Replace (or create) your .htaccess file with the following text. For the sake of simplicity and usability, this .htaccess file doesn't use the deny from 0.0.0.0 type of entries. All banning should be done using the SetEnvIf directive. Make sure they appear at the top of the .htaccess file and before the following text.
<Files ~ "^.*$">
order allow,deny
allow from all
deny from env=ban
</Files>
I assumed that meant that I would need to replace my old directives with something in a similar <files> format?