Knowledge base
1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Checking the source (referrer) of image requests
To limit access to images on your server, create an .htaccess file into which you need to place the following contents:
ErrorDocument 403 "Access denied
setenvifnocase referer ^http://(www.){0,1}domain.xyz/.* ok
order deny,allow
deny from all
allow from env=ok
v=local_ref
You can also use mod_rewrite. Example .htaccess directives:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://(www.)?domaine.xyz/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^-?$ [NC]
RewriteCond %{HTTP_REFERER} !^http://babelfish.altavista.com/ [NC]
RewriteCond %{HTTP_REFERER} !^http://translate.google.com/ [NC]
RewriteRule .*.(jpg|jpeg|gif|png|bmp)$ - [F,L]
Link to this FAQ: