Protect Image From Other Sites

Sometimes other sites use our images, but there is no link us. Only it is fill our bandwidth limit. We can ban that users or we can show another image for that sites. You can write that image “This images can download in www.domain.com”. You have to add this codes to .htaccess

Change domain with your domain name and sucks.jpe is your image to show

<IfModule mod_rewrite.c>
 RewriteEngine on
 RewriteCond %{HTTP_REFERER} !^$
 RewriteCond %{HTTP_REFERER} !^http://(www\.)?domain\.com/.*$ [NC]
 RewriteRule .*\.(gif|jpg)$ http://www.domain.com/sucks.jpe [R,NC,L]
</ifModule>

If you want to serve a standard 403 forbidden error page

RewriteRule .*\.(gif|jpg)$ - [F,L]

If you want to add your friends sites to allow link

RewriteCond %{HTTP_REFERER} !^http://(www\.)?myfriend\.com/.*$ [NC]
Oyun