Re: redirect http to https

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

 



Ben Liu escribió:
What's the prescribed method for redirecting a user forcibly to from the non-SSL secured version of a page to the SSL-secured version? Is this handled at the web server level or at the script level. I found this by googling:

This should be done with the rewrite instruction of apache, or what ever instructionyour web server has.

<?php
if($_SERVER['SERVER_PORT'] !== $encport || $_SERVER['HTTPS'] !== "on")
{header("Location: https://".$_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME']);exit;}
?>

Very bad solution.

--
select 'mmarques' || '@' || 'unl.edu.ar' AS email;
---------------------------------------------------------
Martín Marqués          |   Programador, DBA
Centro de Telemática	|     Administrador
               Universidad Nacional
                    del Litoral
---------------------------------------------------------

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux