Jump to content

Recommended Posts

Posted

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

Posted

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. :lol:

 

besides, the only other way I've seen to do it is convoluted, requires sessions, and is fairly slow and cpu intensive (comparatively).

Posted

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?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...