ukscotth Posted January 17, 2010 Share Posted January 17, 2010 Hi, I run a site that contains images I dont want people to steal. I know its impossible to stop them but I want to make it as difficult for them as possible. I have seen people posting my sites images url's on various other sites and I thought I could stop them by changing the image filenames every now and again. Anyone have any ideas to how I could do this ? maybe using a cron job or something similar. Also does anyone know any other methods I could use to help stop people stealing my images ? Thanks in advance. Scott Quote Link to comment https://forums.phpfreaks.com/topic/188788-protecting-online-images/ Share on other sites More sharing options...
ignace Posted January 17, 2010 Share Posted January 17, 2010 add a watermark to your images. Quote Link to comment https://forums.phpfreaks.com/topic/188788-protecting-online-images/#findComment-996687 Share on other sites More sharing options...
Buddski Posted January 17, 2010 Share Posted January 17, 2010 Other than using a watermark, you can also get PHP to actually generate your images for your site.. So on your site you will have <img src="images.php?file=header.png" /> and inside that script you can check the referrer... Its not fool proof but it sure can help.. Here is a little example I found http://safalra.com/programming/php/prevent-hotlinking/ Quote Link to comment https://forums.phpfreaks.com/topic/188788-protecting-online-images/#findComment-996688 Share on other sites More sharing options...
ukscotth Posted January 17, 2010 Author Share Posted January 17, 2010 thanks for your replies. Il have a read of that site Quote Link to comment https://forums.phpfreaks.com/topic/188788-protecting-online-images/#findComment-996694 Share on other sites More sharing options...
waynew Posted January 17, 2010 Share Posted January 17, 2010 You can stop hotlinking by putting this into a .htaccess file and uploading it to the main document root of your website: RewriteEngine On RewriteCond %{HTTP_REFERER} !^http://(.+\.)?YOURSITE\.com/ [NC] RewriteCond %{HTTP_REFERER} !^$ RewriteRule .*\.(jpe?g|gif|bmp|png)$ /images/goatse.jpg [L] [/quote[ Quote Link to comment https://forums.phpfreaks.com/topic/188788-protecting-online-images/#findComment-996785 Share on other sites More sharing options...
ukscotth Posted January 17, 2010 Author Share Posted January 17, 2010 thanks wayne, and what will happen when they try ? and can I use that for swf files ? Quote Link to comment https://forums.phpfreaks.com/topic/188788-protecting-online-images/#findComment-996792 Share on other sites More sharing options...
waynew Posted January 17, 2010 Share Posted January 17, 2010 RewriteEngine On RewriteCond %{HTTP_REFERER} !^http://(.+\.)?YOURSITE\.com/ [NC] RewriteCond %{HTTP_REFERER} !^$ RewriteRule .*\.(jpe?g|gif|bmp|png|swf)$ /images/NOSHOW.jpg [L] NOSHOW.jpg is the file that they'll be shown instead. Quote Link to comment https://forums.phpfreaks.com/topic/188788-protecting-online-images/#findComment-996845 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.