воскресенье, 21 июля 2013 г.

Prevent hotlinking with .htaccess

RewriteEngine on
//Disallow blank referrers, but I recommend to not use it.
RewriteCond %{HTTP_REFERER} !^$ [NC,OR]
//Sites allowed to link your images
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yourdomain.com [NC,OR]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yourdomain2.com [NC]
//Change ‘http://hpmouse.googlepages.com/hotlink.gif‘ to a image you’ve set, and whenever image hotlinking is detected,
RewriteRule \.(jpg|jpeg|png|gif)$ http://hpmouse.googlepages.com/hotlink.gif [NC,R,L]

Комментариев нет:

Отправить комментарий