In php it works really well too, to do a simple redirect by:
Code:
header("Location: http://www.redirecturl.com/");
You can also force a page to https:// or back to http:// for secure sites in php. I know you can do this in .htaccess, but this has worked for me. Basically, you could would call forcehttps(); or killhttps(); for those pages that you want to secure or unsecure:
Code:
function forcehttps(){
if (!isset($_SERVER['HTTPS']))
{
$ref = $_SERVER['REQUEST_URI'];
header("Location:https://www.securesite.com".$ref);
exit;
}
}
function killhttps(){
if (isset($_SERVER['HTTPS']))
{
$ref = $_SERVER['REQUEST_URI'];
header("Location:http://www.nonsecure.com".$ref);
exit;
}
}
Now, it would be good to find a better way to secure subdirectories from browsing - I have in the past included a simple index.php with nothing in it, just to make the sub-directory inaccesible. I know there must be a better way in htaccess to do that, but from what I've seen it is a bit more verbose. Maybe there is a reason I don't need to include an empty index file in my subdirectories, but it has worked so far.
Charles