Outside the Cube (7611)
Web publishing (65)
about DelphiFAQ (14)
perl CGI (3)
Web Hosting (8)
New related comments
Number of comments in the last 48 hours
Referer spam in my web server's log files
How to update a htdig search engine database
Regular expressions in Homesite
My font-weight property in CSS is ignored
How to block others from using images on my web site
6 comments. Current rating: (2 votes). Leave comments and/ or rate it.
Question:How can I prevent other web sites from using images on my web server?
Answer:You cannot really do much against them keeping a copy of the image on their server. You could apply a digital watermark to your images that is invisible to the human eye and - depending on the technology - will stay in there after basic image editing.
That way, if someone steals your image, at least you can prove that they are your images and possibly sue because of copyright infringement. (Make sure to have a disclaimer that all content is copyrighted).
You can do something against what is called 'Hot linking' - which is when the hostile web site directly links to the images on your domain. Not only do those webmasters steal your content, they even steal your bandwidth!
If you use the apache web server, then you can put the following code in the .htaccess file. This .htaccess file should be in the www root directory or in any subdirectory where you want files to be protected from hotlinking:
This solution bases on apache's mod_rewrite. It also relies on the HTTP_REFERER field, which means that a very small number of users who block the REFERER header, wil be able to see the stolen images. (This is less than 1% of all surfers according to my experience.)
In the first section the htaccess file lists a few domains that shall be allowed to retrieve images. No referrer, your own domain, 'another domain you want', altavista web site translation etc are allowed.
Make sure to replace mydomain.com in there with your actual domain name, otherwise your pages will show up without images.
The document /blank.html should be an existing document, otherwise your web server will throw an 404 error into your logs, looks bad. To save bandwidth, just create a file of length 0 bytes and save it as blank.html in your root.