Re: How do I prevent remote loading of jpegs from my site
| From: | PHP Mail | Date: | Sun, 28 Oct 2001 18:59:57 +0000 |
| Subject: | Re: How do I prevent remote loading of jpegs from my site | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-72631@lists.php.net to get a copy of this message | ||
With Apache this goes in the <VirtualHost> block.
# Turn on the rewrite engine
RewriteEngine on
# The next line means ignore lines without a referrer
RewriteCond %{HTTP_REFERER} !^$
# Then ignore lines that the referrer was any host at "our_domain.com" (the good guys).
RewriteCond %{HTTP_REFERER} !^http://.*our_domain.com/.*$ [NC]
# Rewrite lines that had the request for *.jpg or *.jpeg or *.JPG or .JPEG or *.gif or .GIF and so on to a small warning gif file.
# That says, "Don't steel our bandwidth. If you are receiving this in error contact jobob@squeelllikeapig.com."
RewriteRule .*[Jj][Pp][Ee][Gg]$|.*[Jj][Pp][Gg]$|.*[Gg][Ii][Ff]$ http://all-ghost.com/banners/bandwidth_stolen.gif
Amazing isn't.