Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.
I've come up with a solution that may work, but I'd love to hear what you all think of it...
I put this .htaccess file in my images subdirectory:
RewriteEngine On
RewriteRule ^([A-Za-z0-9/]+\.(gif|jpg|png))$ /images/img.php?file=$1&ext=$2Then, I created "img.php" in the images subdirectory. Its contents are:
<?php
# If a file name was not given, exit.
if (strlen($_GET['file']) == 0 || strlen($_GET['ext']) == 0) exit();
# If there was no referrer (blocked or URL entered directly), redirect to policy.
if (strlen($_SERVER['HTTP_REFERER']) == 0)
header('Location: /image_viewing_policy');
# Set the content type for this image.
header('Content-type: image/' . $_GET['ext']);
# Print the image file.
echo(file_get_contents($_GET['file']));
?>This seems to work as I had hoped, but I'm concerned about the performance implications as the site grows. What do you think?
1 to 2 of 2