Forum Moderators: phranque
Basically my question is: What can be done with the hotlink protection system in cpanel?
The cpanel system allows me to designate which domains are allowed to display images from my site; all others will be denied. I can also designate a "redirect" URL. In the example shown in the cpanel instruction manual, this redirect URL is an HTML file.
I don't get it. The hotlinker's page is asking for an image file. What happens when an HTML file is served? What should be the content of such a file? (<BODY> tags, <A HREF . . .> tags, <IFRAME> tags?) Is there a way to serve a file to a hotlinker that will cause a link to my site to be displayed? A script that will cause their page to refresh to my homepage?
If the redirect is an image, won't there be a problem if the <IMG HEIGHT and WIDTH> are set in the hotlinker's page; thus corrupting the "redirect" image that I serve to hotlinkers?
[edited by: Ed_Gibbon at 5:14 pm (utc) on Feb. 26, 2003]
Never having messed with the website manager files or the C Panel ... I will need step by step instructions though.
If you have access to mod_rewrite or mod_alias from within .htaccess, you sure don't need the restrictions of cpanel!
Back OT,
I've used the redirect-to-image method before, and generally have used an image of text saying something like "This image stolen from www.mysite.com". Yes, it can get enlarged, shrunken, stretched to portrait or landscape orientation, etc., but if you use a simple easy-to-read font, it still comes through OK. Besides, it makes the hot-linkers site look amateur, not yours.
However, returning an alternate image can be much more fun, especially when it looks like someone is trying to sell a rusty old shrimp boat as a yacht for $450,000, Liane... ;) Another one I liked was someone put up a graphic saying, "Free overnight shipping on all purchases!" on a hot-linker's site. That was really cold (So I liked it). :)
But trying to redirect from one file type (e.g., a .gif file) to another (e.g., an .html file) does not work very well. IE just displays a broken image link for many such combinations. So, I either use an image of text as described above, providing both a .gif and .jpg version, or just return a 403-Forbidden response to make the hot-linker's site look broken, and save myself some bandwidth.
HTH,
Jim
or just return a 403-Forbidden response to make the hot-linker's site look broken, and save myself some bandwidth.
Yep.... That's my preferred way to do it. While it's fun to link another image and really mess with people, if your site gets big there are so many places that might be linking to it that it's just easier to 403 it and save the bandwidth of sending an image back. Since it makes there site look broken and sloppy, it can be just as effective as an image of your choice without the extra hassle.
RewriteEngine on
RewriteCond %{HTTP_REFERER}!^$
RewriteCond %{HTTP_REFERER}!^http://USER_DOMAIN.COM/.*$ [NC]
RewriteCond %{HTTP_REFERER}!^http://WWW.USER_DOMAIN.COM/.*$ [NC]
RewriteRule .*\.(gif¦GIF¦Gif¦jpg¦JPG¦jpeg)$ - [F]