Re: Leechers...
| From: | daniel hahler | Date: | Tue, 09 Dec 2003 14:06:31 +0000 |
| Subject: | Re: Leechers... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-172260@lists.php.net to get a copy of this message | ||
on Tue, 9 Dec 2003 12:49:56 +0000 Tristan.Pretty@risk.sungard.com wrote:
TPrsc> I want to now be able to stop people from linking to the images directly,
TPrsc> and only be able to access the images via my site...
With Apache you can either use mod_rewrite:
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://domain.com.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.domain.com.*$ [NC]
RewriteRule .*(gif|png|jpe?g)$ - [F]
or more general method (don't know which mod this is):
#prevent refering to my images
SetEnvIfNoCase Referer "^http://www.domain.com/" locally_linked=1
SetEnvIfNoCase Referer "^http://domain.com/"
locally_linked=1
SetEnvIf Referer "^$" locally_linked=1
<FilesMatch "\.(gif|png|jpe?g)$">
Order Allow,Deny
Allow from env=locally_linked
</FilesMatch>
both can be added to your .htaccess file.
--
shinE!
http://www.thequod.de ICQ#152282665
PGP 8.0 key: http://thequod.de/danielhahler.asc