Re: Files only available via HTTPS

From: Date: Fri, 09 Feb 2001 02:32:06 +0000
Subject: Re: Files only available via HTTPS
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-38875@lists.php.net to get a copy of this message
HTTPS is set to "on", at least on my Apache when SSL is enabled. it's undefined when it's not. this is what I would do (untested code below): function UsingHTTPS() { $HTTPS = getenv("HTTPS"); return ($HTTPS == "on"); } function UsingHTTP() // might be useful? { return !UsingHTTPS(); } function ChangeTransport($transport) { $vars = array("REQUEST_URI", "SERVER_NAME"); foreach ($vars as $var) { $$var = getenv("$var"); } $newURL = "Location: $transport://".$SERVER_NAME.$REQUEST_URI; header($newURL); exit(); } and then do a: if (!UsingHTTPS()) { ChangeTansport("https"); } -aaron At 4:29 PM -0800 2/1/01, Michael Conley wrote:
I have several PHP files that I only want users to be able to access via HTTPS. How can I control that on an Apache 1.3.14 server running on RedHat 7? I have openssl and mod_ssl working fine. Currently, I can access all of the files on my site via either http or https. I want to keep certain files (with interesting information) from being accessed via http. I realize this isn't really a PHP question, but I have no idea how to do this. Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net


« previous php.general (#38875) next »