i've moved to a new server and this code doesnt work anymore for some reason
if it you can get it working either here's another way:
1) set a 404.php as your 404 handler in your .htacess or httpd.conf
Code:
ErrorDocument 404 /404.php
and put this in
Code:
<?
ob_start();
if ($ref=="") $ref=$REQUEST_URI;
if (preg_match ("#/forums/t\d*-s.html#",$ref)) {
$ref=str_replace("/forums/t","",$ref);
$ref=str_replace("-s.html","",$ref);
Header("Location: http://domain.com/forums/showthread.php?threadid=".$ref );
}
if (preg_match ("#/forums/f\d*-s.html#",$ref)) {
$ref=str_replace("/forums/f","",$ref);
$ref=str_replace("-s.html","",$ref);
Header("Location: http://domain.com/forums/forumdisplay.php?forumid=".$ref );
}
ob_end_clean();
?>
important: my forums are under /forums and i have my links like t4444-s.html not t4444/s555555.html (with a - not / and without the session number). change the code according to your situation
if anyone uses it, let me know if it works for you
ps. there one issue with this sollution: you still get a line in your error log about a missing file...