I realise people are starting to steal my images. I'm not concerned about my bandwidth - I just don't really like people doing it. I saw some sites use a script where when someone hotlinks an image from a site this banner comes up saying "You have stolen from "thisite". Would anyone know where I could find a script like this to prevent people stealing my images?
Thanks.
http://altlab.com/htaccess_tutorial.html
This tells how to create a .htaccess file to stop hotlinking. :-)
A code to prevent hotlinking has already been posted a few weeks ago.
Here it is :
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^(http://(www\.)?freepgs.com/webzone(/.*)?)?$ [NC]
RewriteRule \.(gif|jpg|png)$ / [F,L]
Simply change the RewriteCond line to match your website address and put this inside your .htaccess inside your root directory (ftp.freepgs.com) or inside /httpdocs (plesk.lvcs.net). It should return a "403 - Forbidden" error when an external site uses your images (.gif, .jpg, .png).
Ergg, that just made all the images on my site go and I got a server error. That wasn't exaclty what I wanted.
That external error appears on my site as well? How can I change this :/
QuoteErgg, that just made all the images on my site go and I got a server error.
Server Error means that Apache does not understand your .htaccess code. You have certainly made a mistake somewhere when copying this code, as I already tested it on two accounts and got no errors.
Could you copy the contents of .htaccess and post it here?
[NC needs a closing bracket like [NC]
Ok well the site works now - exept all the images are gone broken :/
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^(http://(www\.)?habbo-hood\.com/dir(/.*)?)?$ [NC]
RewriteRule \.(gif|jpe?g|bmp|png)$ / [F,L]
The code right above should work properly on your site. Could you try?
That just makes the images broken on my site. Take a look
habbo-hood.com
I just realised that the .PNG images only work...
All works for me... I can see your images on your front page but I can't hotlink them.
Try to clean up your browser cache.
Forget about my comment, I tested in Opera without sending the referer header. I'm awfully sorry.
I just realised : you don't have a /dir/ directory on your site, but you require it to be present in the referer header. You may be luckier with this code :
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^(http://(www\.)?habbo-hood\.com(/.*)?)?$ [NC]
RewriteRule \.(gif|jpe?g|bmp|png)$ / [F,L]
Ahhh thats it! Now is there a way where if someone stole an image a image on their site will appear saying " Don't Steal" or something like that?
Figured it out. No need to help me. Thanks a lot! Your a big help !
Quoteimage on their site will appear saying " Don't Steal" or something like that?
It is possible, but remember that this image will have a fixed size. When it will be displayed on the "other website", it might be distorted or unreadable if the stealer used height and width attributes.
QuoteThanks a lot! Your a big help !
You're welcome.