This topic is locked

SSL and dbcommon.php

4/16/2008 8:24:21 PM
PHPRunner General questions
F
Fawaz author

In PHPRunner version 4.1 I used to have this code to force redirect all pages from http to https

if($HTTP_SERVER_VARS["HTTPS"] != "on")
{
$newurl = "https://www."; . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
header("location: $newurl");
}


I was putting this code in dbcommon.php
However, in PHPRunner version 4.2, the code doesn't seem to work.
Do I need to change my code?
Thanks,

Fawaz

Alexey admin 4/17/2008

Fawaz,
I have no idea why your code isn't working.

Try to debug it.
There are no changes in PHPRunner 4.2 that may break this code.

F
Fawaz author 4/17/2008

Fawaz,

I have no idea why your code isn't working.

Try to debug it.
There are no changes in PHPRunner 4.2 that may break this code.


Hi Alexey,
I believe there's a difference, this code doesn't exist in PHPRunnner version 4.1

if(@$_SERVER["REQUEST_URI"])

{

$pinfo=pathinfo($_SERVER["REQUEST_URI"]);

$dirname = @$pinfo["dirname"];

$dir = split("/",$dirname);

$dirname="";

foreach($dir as $subdir)

{

if($subdir!="")

$dirname.="/".rawurlencode($subdir);

}

if($dirname!="")

{

// @session_set_cookie_params(0,$dirname);

}

}



I tried to put my code above and under the previous code, however both cases didn't work.
Why did you add the previous code in PHPRunner version 4.2? And how/where can I apply my code?
Thanks,

Fawaz

Sergey Kornilov admin 4/17/2008

Fawaz,
I would suggest to use .htaccess for this purpose. There is a whole lot of info on the net in this regard.

Check this for example: http://joseph.randomnetworks.com/archives/...aches-htaccess/