WAdotcom Posted September 30, 2003 Posted September 30, 2003 Hello, I currently run a bulletin board (IPB) on my site and many members are requesting an "upload forum" where they can upload their images for graphics competitions. I know this will lead to a higher amount of bandwidth request so before I make this forum, I want to set my site to enable hotlink protection so that members can't link images that they uploaded on other sites. The problem is that I have certain images that I DO encourage my site members to hotlink (images that promote the site). These images are located in a completely different location from the /forums directory. When a user uploads an image, it will get saved to the following URL: www.mysite.com/forums/uploads/image.jpeg Is there a special code that I can put in my .htaccess file that will DISALLOW hotlinking images that are in my /forums directory but ALLOW hotlinking images that are outsite of the /forums directory? (like the /images directory)? Thanks, Rodney Quote
DarqFlare Posted September 30, 2003 Posted September 30, 2003 "HotLink Protection" in CPanel on the right side. Quote
WAdotcom Posted October 1, 2003 Author Posted October 1, 2003 That's only to protect the entire site from being hotlinked. I only want to protect the /forums directory. Quote
vendlus Posted October 1, 2003 Posted October 1, 2003 You should be able to use an .htaccess file in your forum's directory to do what you want. It should affect that folder (and any below it, like 'forum/sigs'), but not others. Here's a thread with what you need to know (I think... I'm new to htaccess). http://forums.devshed.com/t54474/s.html *edit* yes, htaccess does use the referer property, which isn't ideal since it can be faked if the person knows what they are doing. But the odds that enough people will know how (and care enough to go through the trouble) to affect your bandwidth is slim. besides, the only other way I've seen to do it is convoluted, requires sessions, and is fairly slow and cpu intensive (comparatively). Quote
WAdotcom Posted October 2, 2003 Author Posted October 2, 2003 Thanks for the help but I'm still not getting this. Does this mean that I have to go to my /forums directory and make a file there and call it ".htaccess"? Also, what exact code do I have to put in there? I want to make it so that when someone attempts to link an image from the /forums directory of my site to another different site, the image will not load on that site and instead show that red 'X'. What exact code would I have to put in? Quote
WAdotcom Posted October 2, 2003 Author Posted October 2, 2003 Please disregard, I think I got it now. Thanks, Rodney Quote
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.