[FX.php List] [OFF] Rewrite for forcing http to https possible?

biscuit technologies biscuit.tech at gmail.com
Thu Sep 11 16:44:52 MDT 2008


I'm not sure if you're asking my why one is better than the other, but the
reason I like the rewrite rule is that it applies to the whole domain
regardless of what kind of pages I'm serving and only requires me to edit
one file.
In the original post part of the requirements were:
I do want people to be able to access it using http, but have those
redirected to the very same URL, but as https instead.

- David

On Thu, Sep 11, 2008 at 3:35 PM, Bob Patin <bob at patin.com> wrote:

> Why is that any better?
>
> What's the difference? Both are redirects of a sort...
>
> BP
>
>
>
> On Sep 11, 2008, at 5:26 PM, Gjermund Gusland Thorsen wrote:
>
>  <?
>> header( "Location: https://www.site.com/page.htm" );
>> exit;
>> ?>
>>
>> 2008/9/12 Bob Patin <bob at patin.com>:
>>
>>> Tim,
>>> Is there a compelling reason why that's a better method? Since the
>>> redirect
>>> happens immediately, there isn't any security issue there, is there?
>>> Just wondering... always willing to learn a better way to do things... :)
>>> BP
>>> Bob Patin
>>> Longterm Solutions
>>> bob at longtermsolutions.com
>>> 615-333-6858
>>> http://www.longtermsolutions.com
>>> iChat: bobpatin
>>> AIM: longterm1954
>>> FileMaker 9 Certified Developer
>>> Member of FileMaker Business Alliance and FileMaker TechNet
>>> --------------------------
>>> FileMaker hosting and consulting for all versions of FileMaker
>>> PHP • Full email services • Free DNS hosting • Colocation • Consulting
>>>
>>> On Sep 11, 2008, at 5:15 PM, Tim 'Webko' Booth wrote:
>>>
>>> Well, if they're actually the same page but on different ports (80 for
>>> http,
>>> ?? for https) I'd use a server side redirect rather than a client-side.
>>>
>>> I'd think that with some of the SERVER variables you could do something
>>> like
>>>
>>> <?php if ($_SERVER['SERVER_PORT'] == 80) {
>>> //Construct a variable pointing back to the same name under https
>>> $server = $_SERVER['SERVER_NAME'];
>>> $page = $_SERVER['PHP_SELF'];
>>> header['location: https://$server/$page/'];
>>> } ?>
>>>
>>> (And I'm certain that is not correct code, but it's where I'd start and
>>> fiddle with it from there...)
>>>
>>> Cheers
>>>
>>> Webko
>>>
>>> _______________________________________________
>>> FX.php_List mailing list
>>> FX.php_List at mail.iviking.org
>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>>
>>>
>>>  _______________________________________________
>> FX.php_List mailing list
>> FX.php_List at mail.iviking.org
>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20080911/41f14626/attachment.html


More information about the FX.php_List mailing list