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

Troy Meyers tcmeyers at troymeyers.com
Thu Sep 11 16:28:56 MDT 2008


Bob and Dale,

I think I'd prefer the RewriteRule because it needs to apply to EVERY file that the new lab.troymeyers.com serves, and though I in my example I gave two URLs that look like static pages, most aren't, and there's a whole lot of PHP processing that occurs way before the <HTML><HEAD><META> area even comes up. There are numerous pages of the nature of:
http://lab.troymeyers.com/flasking/item.php?id=TN1525&kind=plant
which I would want redirected to:
https://lab.troymeyers.com/flasking/item.php?id=TN1525&kind=plant
...so if I were to not use the RewriteRule method, I'd probably be better using a PHP redirect, with header('Location...) calculated from the $_SERVER stuff right at the top.

But even that method means I have to change all my PHP files. I'm lazy, and I thought changing it in one place would be better (may I say "more elegant" instead of lazy?) than changing it in numerous PHP files, and having to change them all again later if I want something different.

Also people have lots of these sorts of URLs bookmarked or mentioned in orchid forums, which of course I can't change to https, so people will continue to access them that way (and I want them to be able to) so I do have to have some sort of mechanism.

Oh, one other problem, there are still numerous CDML pages handled by Blackbelt (will ultimately be replaced and I'm working on it) but that makes it more difficult to patch them using any method, so again I prefer RewriteRule if possible.

Am I all wet?

-Troy


........................
Dale said:
> Troy,
> 
> This is how I've done it as well.
> 
> Dale
........................
Bob said:
> <HTML>
> <HEAD>
> <META HTTP-EQUIV="Refresh" CONTENT="0;url=https://www.site.com/ 
> page.htm">
> </HEAD>



More information about the FX.php_List mailing list