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

Gjermund Gusland Thorsen ggt667 at gmail.com
Thu Sep 11 16:26:59 MDT 2008


<?
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
>
>


More information about the FX.php_List mailing list