Re: how to setup mod_ssl to accept only https requests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>Davide wrote:
>You have two way: remove the 'Listen 80' option, basically disabling the
>whole http part, or add a 'RedirectPermanent / https:...' to the default
>http vhost to redirect all the http request to https.

You could also call the following php function at the top of each page where you want to use SSL:
 
function redirect_to_https() {
if ($_SERVER['HTTPS']!="on") {
      $redirect = "https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
      header("Location:$redirect");
   }
}
-Lyle

[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux