Forum Moderators: phranque

Message Too Old, No Replies

Disallow users from directly referring to image files

         

windspinner

3:28 am on Nov 28, 2006 (gmt 0)

10+ Year Member



How do I disallow my users from directly referring to my image files? I mean, normally, when everything is at default, users can view any image you place in your folders by directly referring to them, for instance, you say:

[sitename.com...]

and the image displays at your browser.

But then, what I wanna do is that when they type the image path, I'd like to redirect them to a file that will call the image, format it, and display it. Is this possible?

jdMorgan

4:11 am on Nov 28, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Mod_rewrite code to pass all .jpg image requests to /image_handler.pl script with requested filepath passed as query string data:

RewriteRule ^([^.]+\.jpg)$ /image_handler.pl?requested_image_path=$1 [L]

Jim