I'm using a client side redirect that I would like to change to server
side. Right now I am using this bit of php to redirect if the user agent
is not lftp.
<?php
$ref = $_SERVER["HTTP_USER_AGENT"];
if (strncmp($ref,"lftp",4) != 0) {
header( "Location:
http://new.location.com/some/page" );
}
exit( 0 );
?>
What I would like is to to redirect everything coming from outside my lan
(192.168.128.0/24) , wan (10.10.0.0./16), and not using lftp. I want it
to work for any subdirectory as well.
I've included this in my vritual host file but it doesn't work; I still
get indexes if I go directly to the images directory or to any
subdirectories below it.
<Location /blog/Travels/images/>
RewriteEngine on
RewriteCond %{REMOTE_ADDR} !^192\.168\.128\.*
RewriteCond %{REMOTE_ADDR} !^10\.10\.*
RewriteCond %{HTTP_USER_AGENT} !^lftp*
RewriteRule .* /blog/Travels
</Location>