Re: URL verification
| From: | Marek Kilimajer | Date: | Fri, 08 Oct 2004 14:56:25 +0000 |
| Subject: | Re: URL verification | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-198972@lists.php.net to get a copy of this message | ||
Bruno Santos wrote:
Hello all. I have a login page where users have to authenticate themselves to access some site areas. Apache is configured to use https. the user when is typing the URL in the browser, i know that it will not put the https protocol. how can i check in the page if the user is accessing the the site via SSL ??$_SERVER['HTTPS'] if ( !isset($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) != 'on' ) { header ('Location: https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); exit(); }
or i have to put a redirect in the page anyway, whether the user is alredy accessing the page via SSL?No, this would create infinite redirects.
cheers Bruno Santos