About a week or so ago, I was extremely frustrated while trying to save a photo off a website. Each time I tried to save the image off the website, to my desktop, I would end up with just the website logo! I even went directly to the image and tried saving it, but I STILL ended up with just the logo! Ironically enough, I now have a web client that wants this feature put on their site, but I don't know how to do it. It is something I thought was impossible until I saw it last week and I believe it is something that can only be done with a .HTACCESS file. Can anyone shed some light on how it is possible to do this sort of thing with .HTACCESS and preventing images from being saved?
.htaccess prevent hotlinking. Sorry to be that vague, lol. But there are plenty of examples online. Good luck.
I don't think you understand what I am trying to do. It is to prevent SAVING an image. It has NOTHING to do with hotlinking. I don't know how I can make myself more clear I know the trick can be done because people are doing it.
It's actually the same. When you hit "save" on your browser, it re-requests the image. And it does this without sending the referrer of the website which you're currently on. Their htaccess file tells Apache to block access to images if the referring request doesn't come from their website and they send you another image instead which you're not interested in. Simple as that.
I've never seen it before. It could be a nice thing to know how to do though. I'll look into it and ifIi find anything I'll let you know.
Ok, so how do I do this with .htaccess? I have very little knowledge of how to implement something like that
I still think you don't understand. I already have an anti-hotlinking .htaccess script implemented on my site. That is taken care of. Now I am looking for something different - to prevent image downloads.
I think you don't understand. What do you think does the browser do when it loads your page? It downloads the image. When the browser downloads the images from your website, it sends your website URL as referrer. Your htaccess file allows this request because it comes from your website. As explained above, if you click "save", it re-requests the image, without the referrer. With htaccess you can change it so, that if the request doesn't come from your site, you can send a default image (usually a "please don't hotlink" image.) - Also known as hotlinking! The referrer is the only way to detect whether a user is downloading the image with his browser or if it comes from your website. And even then, it's still easily fakable. You can not (under any circumstances) prevent the user from downloading the images from your website. You can only make it more difficult.
No no, what the guy is saying. He right clicks on the image and saves it and he goes to the image is he just has a 1x1 gif or something. That is not a hotlinking trick. There is a transparent image that is overlayed ontop of the real image. You can't see the image because its transparent. But when you right click on the image and save it your grabbing the clear fake image. This can be easily workaround though. Firefox has a page info with right click and you can view all the images on the page and just find it in the list and hit "save as.." or just view the source. or save the entire page to your harddrive and dig around in the files. But internet users are not that computer savvy.
lol. Oops Nico_swd dI deleted my post. I felt as if I were wrong after re-reading what he wrote. Yes the logo could be overlayed on the image with 0% opacity with javascript. But he says he even put a direct link and trys to download it? I don't know. souljaboygear you should of provided a link to the site in question.
I know I arrived late to the party but... could this do what is being asked??? RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://(www\.)?example.com/.*$ [NC] RewriteCond %{REQUEST_URI} !^/images/stealing\.gif$ RewriteRule \.(gif�jpg)$ http://www.example.com/images/stealing.gif [R,L] Code (markup): Again this seems more like a HotLinking fix. I must say I have never seen a site that has been able to fully prevent a visitor from saving an image. I mean if it serves it up then it *can* be saved. heck you could SCREEN SHOT the damn thing ifyou really wanted too.
Exactly, this is why Web authors who go to lengths to try and protect their images or html whatever have you, are wasting their damn time. If their determined enough, they will get your files.