Click to See Complete Forum and Search --> : htaccess question


Ravasz
03-15-2005, 03:01 AM
I wondered if it was possible to allow text links to files, but still deny direct hotlinking.

For instance, I see people on forums put up text links to images on my site, and that's okay with me, but the links end up blocked because I have htaccess in place. I just want it there so people can't use things like the image tag and put my material on their webpage, etc.

Help is appreciated. =)

AdamGundry
03-15-2005, 12:16 PM
Yes, check out this A List Apart article (http://www.alistapart.com/articles/hotlinking/).

Adam

Ravasz
03-16-2005, 12:01 AM
Shoot, I'm terrible at PHP. That script is just what I need, and while I have everything to support it, I can't get it to work.

I assume you understand it, so is it possible you could show me what the image tag line should look like? I think that's where the problem is, with this: <img src="/<?php echo($pic); ?>" alt="Image"> and the corresponding tag in the title. Does it mean that I should enter the path to an image in there? How?

Help, as always, is appreciated.

AdamGundry
03-16-2005, 09:33 AM
You shouldn't need to edit the PHP file itself. That variable is loaded from the query string, which in turn comes from the filename that has been requested, so it should contain the correct filename automatically.

Adam