Lycos has been taking over various hosters in the past (Multimania, Tripod etc.),
and their webserver setup is a bit weird compared to "normal" webhosters.
For instance, if you're hosted at http://members.lycos.fr/ it will add
"/multimania/fr" in front of the REQUEST_URI environment variable, and if you're
hosted at http://members.lycos.co.uk/ it will add "/tripod/uk" in front of it.
The problem is that PostNuke .714 (and earlier) relies on that environment
variable to create some links or to specify where users should be redirected to
after logging in, so you end up with a 404 error.
How to know if you have this problem :
If you are on a Lycos host, and you get redirected to a 404 error page, go back
to your index.php page, and in your browser do a View HTML Source. You should
find a hidden field name="url" value="/some/garbage/your_url" near the login
block. If you do find something in front of your regular site URL, write down
the /some/garbage part that applies to you, and read on...
How to solve this :
1) in /includes/pnAPI.php, add the following function before the last ?> line :
function getLycosURL()
{
// for members.lycos.fr
$mygarbage = "/multimania/fr";
// for members.lycos.co.uk
// $mygarbage = "/tripod/uk";
// fill in your own garbage :-)
// $mygarbage = "/some/garbage";
$myurl = getenv("REQUEST_URI");
$myurl = preg_replace("!$mygarbage!",'',$myurl);
return $myurl;
}
2) do a global search for REQUEST_URI in the PostNuke source, and replace
anything that relies on it with a call to getLycosURL() :
2.a. in /includes/blocks/login.php, replace the line
$boxstuff .= '';
by this line
$boxstuff .= '';
2.b. in /includes/pnAPI.php, find this line
if (isset($_SERVER['REQUEST_URI'])) {
and replace it with the following lines :
$myurl = getLycosURL();
if (isset($myurl)) {
$path = $myurl;
}
elseif (isset($_SERVER['REQUEST_URI'])) {
2.c. in error.php (in case you're using it), replace this line
$message .= ""._ERRMAILURI." \n" . pnGetBaseURL(). "$_SERVER[REQUEST_URI]\n\n";
by this line
$message .= ""._ERRMAILURI." \n" . pnGetBaseURL(). getLycosURL() . "\n\n";
and this line
$rqurl = trim(preg_replace('/("|\?|!|:|\.|\(|\)|;|\\\\)+/', ' ',
$_SERVER['REQUEST_URI']));
by this line
$rqurl = trim(preg_replace('/("|\?|!|:|\.|\(|\)|;|\\\\)+/', ' ', getLycosURL()));
2.d. find any other module that might be using it, and do the same there
Will this work for me ?
I've no idea - you tell me :-)
You might have similar problems in places where PHP_SELF is used instead of REQUEST_URI.
Is this an official PostNuke fix ?
Nope, it's much too quick & dirty for that...
For more tips and tricks, see
Mike's Pub