Advanced geekery: .htaccess, and LIMITED hotlinking

Yes, I’ve seen the .htaccess script language that prohibits off-site image hotlinking.

What I’d like to do is have allow hotlinking to small images (under 50K or so), and prohibit hotlinking large images.

Google was not my friend in this case; I couldn’t find anything. Anyone have any ideas?

Thanks!

I’m almost certain this is not possible. Allowing hotlinking is an all-or-none proposition as far as .htaccess is concerned. At the moment I can’t think of any workaround that might do what you want.

what about putting large images in one folder, and small images in another?

put .htaccess on the large image folder?

I’m not positive but I believe you can place the .htaccess in a subdirectoy(not sure that’s the right term). Anyway, it will only block what is placed within that, so you could place the icons you don’t want linked to there and the others elsewhere. You would of course have to change the links.

This is also what I’d recommend. htaccess can be used within a single directory, so stick your big pics in a prohibited folder.

Thanks for the suggestions, but the different folder idea won’t work. I have a user-contributed photo gallery on my Web site, and the vBulletin-based back end dumps all the images into a series of directories that can’t be sorted by size.

Then just limit the size of the pics that are allowed to be uploaded. The people may have to resize images, but that takes about 5 sec.

This issue then seems to be solely bandwidth limits or cost, not the unauthorized use. AFAIK, placing the htaccess will not stop folks from saving the image, just hotlinking, so perhaps that’s accepatable.

Depending on how you’re setup and how much time you have, you can get software that will “crunch” the file size of the icons so bw can be reduced even if they link.