Now--this should be interesting. I'm having quite a serious issue with my forum, and I'm guessing it has something to do with this hack. Prior to installing it, we hadn't seen it before.
I'm using the following rewrite rules:
Code:
RewriteEngine on
RewriteRule ^/forumdisplay.php(.*)$ /forums/forumdisplay.php$1 [R=permanent,L]
RewriteRule ^/f([0-9]+)/?$ /forums/forumdisplay.php?forumid=$1 [L]
RewriteRule ^/f([0-9]+)/s([^/]+?)\.html$ /forums/forumdisplay.php?forumid=$1&s=$2 [L]
RewriteRule ^/f([0-9]+)/t([0-9]+)/?$ /forums/showthread.php?threadid=$2 [L]
RewriteRule ^/f([0-9]+)/t([0-9]+)/s([^/]+?)\.html$ /forums/showthread.php?threadid=$2&s=$3 [L]
RewriteRule ^/t([0-9]+)\.html$ /forums/showthread.php?threadid=$1 [L]
RewriteRule ^/t([0-9]+)/s([^/]+?)\.html$ /forums/showthread.php?threadid=$1&s=$2 [L]
RewriteRule ^/s([^/]+?)\.html$ /forums/index.php?s=$1 [L]
RewriteRule ^/forums/f([0-9]+)/?$ /forums/forumdisplay.php?forumid=$1 [L]
RewriteRule ^/forums/f([0-9]+)/s([^/]+?)\.html$ /forums/forumdisplay.php?forumid=$1&s=$2 [L]
RewriteRule ^/forums/f([0-9]+)/t([0-9]+)/?$ /forums/showthread.php?threadid=$2 [L]
RewriteRule ^/forums/f([0-9]+)/t([0-9]+)/s([^/]+?)\.html$ /forums/showthread.php?threadid=$2&s=$3 [L]
RewriteRule ^/forums/t([0-9]+)\.html$ /forums/showthread.php?threadid=$1 [L]
RewriteRule ^/forums/t([0-9]+)/s([^/]+?)\.html$ /forums/showthread.php?threadid=$1&s=$2 [L]
RewriteRule ^/forums/s([^/]+?)\.html$ /forums/index.php?s=$1 [L]
I did it this way so that
www.domain.com/f1 links would work as well as
www.domain.com/forums/f1--so far so good. The problem is that every time I follow a link, a new session hash is generated--this means all sorts of login problems.
Could this be related to this hack in some way? I don't even know where to start!
Thanks,
Paul
Edit: I also made an adjustment to online.php. My version looks like this:
PHP Code:
// Hack: Allow WOL to work with spider friendly URLs - Nov 2, 2002 - Paul
/*
$userinfo[activity] = 'unknown';
*/
if (preg_match ("/t([0-9]+)/", $loc, $match)) {
$userinfo[threadid] = $match[1];
$userinfo[activity] = 'showthread';
$threadids .= ",$userinfo[threadid]";
} elseif (preg_match ("/f([0-9]+)/", $loc, $match)) {
$forumid = $match[1];
$forumids .= ",$forumid";
$userinfo[activity] = 'forumdisplay';
$userinfo[forumid] = $forumid;
} elseif (preg_match ("/robots\.txt/", $filename)) {
$userinfo[activity] = 'spider';
} else {
$userinfo[activity] = 'unknown';
}
// End hack: Allow WOL to work with spider friendly URLs