Our website is made possible by displaying online advertisements to our visitors.
Please consider supporting us by disabling your ad blocker.
-
Stop people stealing your pictures....
Hey guys,
Just came across this very useful snippet of code which can be used to prevent "Hotlinking" of your images.
Recently noticed a few disco sites doing this so I thought I would share this handy preventative piece of code I found.
Prevent Image Hotlinking
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^
http://(.+\.)?yourdomain\.com/ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*\.(jpg|gif|bmp|png)$ /images/dontsteal.jpg [L]
Images linked to from anywhere else than your website are redirected to a custom graphic (which you'll need to upload). Do note though, this will not prevent downloading of your images!
This piece of code sits in a .HTACCESS file...
You'll obviously need to make a few updates to it... for example:
"yourdomain\.com/" .... would be your domain name (ie: alexentertainment\.co.uk/ ) and the link to the "don't steal" image would need to be updated to where ever you put the image.
Hope this helps some of you guys out there
-
Web Guru
Hotlinking is more stealing bandwidth than stealing pictures, though.
If someone wants to steal pictures they will (save as....and upload to their webspace).
I personally think allowing hotlinking is better, as at least then you'll find the muppets trying to steal your pictures but who just decide to hotlink instead (from your logs)...without alerting them that you're on to them.
-
Last edited by Vectis; 27-03-2012 at 11:21 AM.
-
Web Guru
Originally Posted by
Alex
You'll obviously need to make a few updates to it... for example:...
You missed a \ your example Alex, in that line you need to escape any . in the domain, so yours would be: -
alexentertainment\.co\.uk/
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules