Forum Moderators: phranque
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} ^BlackWidow [OR]
# A whole load of other agents
RewriteCond %{HTTP_REFERER} ^http://www.iaea.org$
RewriteRule ^.* - [F,L]
and this:
RewriteEngine on
RewriteCond %{HTTP_REFERER}!^$
RewriteCond %{HTTP_REFERER}!^htt(p¦ps)://(www\.)?mysite.com.*$ [NC]
RewriteRule .(gif¦jpg)$ [mysite.com...] [R,L]
If I want to combine these files would it look something like this:
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} ^BlackWidow [OR]
# A whole load of other agents
RewriteCond %{HTTP_REFERER} ^http://www.iaea.org$
RewriteRule ^.* - [F]
RewriteCond %{HTTP_REFERER}!^$
RewriteCond %{HTTP_REFERER}!^htt(p¦ps)://(www\.)?mysite.com.*$ [NC]
RewriteRule .(gif¦jpg)$ [mysite.com...] [R,L]
TIA.........
RewriteCond %{HTTP_REFERER} .
RewriteCond %{HTTP_REFERER} !^https?://(www\.)?mysite\.com [NC]
RewriteRule \.(gif¦jpg)$ /another-image.gif [L]
For the first rule, you might also consider using something like this:
RewriteRule !^(robots\.txt¦custom_403_page\.html)$ - [F]
Jim