Re: force https
| From: | Dan Trainor | Date: | Wed, 29 Jun 2005 03:44:18 +0000 |
| Subject: | Re: force https | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-217796@lists.php.net to get a copy of this message | ||
Robert Cummings wrote:
> On Tue, 2005-06-28 at 23:26, Dan Trainor wrote:
>
>>Ross wrote:
>>
>>>Hi,
>>>
>>>I need to force the url from http://mydomain.com to
>>>https://mydomain.com, so
>>>my ssl is active. Anyway this can be done with php?
>
>
>><i'm a newbie, you've been warned>
>>
>>header('Location: https://mydomain.com'); ?
>>
>></i'm a newbie, you've been warned>
>>
>>I don't know if that would work for an HTTPS referral - however, I don't
>>know why it wouldn't Give it a shot, and if nothing else, let *me*
>>know, even if it's off-list.
>
>
> It'll work fine, but here's a something a little more generic :)
>
> header( 'Location:
>
> https://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']
> );
>
> Cheers,
> Rob.
Hey, you learn something new every day, huh.
Thanks for the tip
-dant