Like most website owners who pay for their own servers, I’ve run into the problem of image files being hotlinked on other websites without permission, resulting in the bandwidth I paid for being used for their benefit.
Fortunately, there are many solutions to this problem, particularly the advice given on hotlink prevention at A List Apart.
I’ve implemented the suggestions they’ve made almost exactly, though I did have to make two changes. The first involves changing a line in the showpic.php
file from <img src="/<?php echo($pic); ?>" alt="Image">
to <img src="<?php echo($pic); ?>" alt="Image">
, as the leading /
caused some url directory issues.
The second change involved adding options +followsymlinks
to the top of my .htaccess
file because server had it off by default, causing and error with the RewriteRule
directive.
Otherwise, everything seems to be running perfectly, and anyone accessing those images either through a direct link, viewing this website, or through the RSS feeds should have no problem viewing the images, while any attempts to hotlink from an unauthorized external will return a simple http error, resulting in less bandwidth loss.
However, if you have any problems with viewing images here, please let me know.