been reading the docs and prior messages in the forum but have not found the answer yet.
is there a way to force the user to utilize https i.e. something at the top of the page to say if not https then exit. i am making a login script but have noticed that the users are capable of accessin the pages i want encrypted with http and https.
any ideas? i looked at the mod_ssl page and only got more confused on the httpd.conf modification.
thanx for any advice!!
sean
force the user to utilize https
Moderator: General Moderators
found it
exactly what i was looking for
Code: Select all
<?php
if ($_SERVER['HTTPS'] !== 'on') {
die("Must be a secure connections");
}
?>
?>-
pistolfire99
- Forum Commoner
- Posts: 58
- Joined: Thu May 23, 2002 3:18 pm
-
pistolfire99
- Forum Commoner
- Posts: 58
- Joined: Thu May 23, 2002 3:18 pm
you will want to use header()
but you may also want to inform them of why they were redirected away.
http://www.php.net/manual/en/function.header.php
later
soshea
Code: Select all
<?php
header('location: http//www.yourpagehere.com');
exit();
?>http://www.php.net/manual/en/function.header.php
later
soshea