Re: redirect http to https
| From: | edwardspl at ita dot org dot mo | Date: | Mon, 09 Apr 2007 13:28:15 +0000 |
| Subject: | Re: redirect http to https | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-252307@lists.php.net to get a copy of this message | ||
Ben Liu wrote:
> 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:
>
> <?php
> if($_SERVER['SERVER_PORT'] !== $encport || $_SERVER['HTTPS'] !==
> "on")
> {header("Location:
> https://".$_SERVER['SERVER_NAME'].$_SERVER
> ['SCRIPT_NAME']);exit;}
> ?>
>
> What do people think about this solution?
>
> Thanks,
>
> - Ben
>
Hello,
Why not config this knid of function by using you Web Server ?