apache,nginx,lighttpd rewrite demo
-----------apache----------
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^archiver/((fid|tid)-[0-9]+\.html)$ archiver/index.php?$1
RewriteRule ^forum-([0-9]+)-([0-9]+)\.html$ forumdisplay.php?fid=$1&page=$2
RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ viewthread.php?tid=$1&extra=page\%3D$3&page=$2
RewriteRule ^space-(username|uid)-(.+)\.html$ space.php?$1=$2
RewriteRule ^tag-(.+)\.html$ tag.php?name=$1
</IfModule>
-----------lighttp------------
url.rewrite-once = ("^(.*)/archiver/([a-z0-9\-]+\.html)$" => "$1/archiver/index.php?$2",
"^(.*)/forum-([0-9]+)-([0-9]+)\.html$" => "$1/forumdisplay.php?fid=$2&page=$3",
"^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$" => "$1/viewthread.php?tid=$2&extra=page\%3D$4&page=$3",
"^(.*)/space-(username|uid)-(.+)\.html$" => "$1/space.php?$2=$3",
"^(.*)/tag-(.+)\.html$" => "$1/tag.php?name=$2"
)
url.rewrite-once = (
"^/archiver/((fid|tid)-[\w\-]+\.html)$" => "archiver/index.php?$1",
"^/forum-([0-9]+)-([0-9]+)\.html$" => "forumdisplay.php?fid=$1&page=$2",
"^/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$" => "viewthread.php?tid=$1&extra=page%%53D$3&page=$2",
"^/space-(username|uid)-(.+)\.html$" => "space.php?$1=$2",
"^/tag-(.+)\.html$" => "tag.php?name=$1"
)
-----------nginx------------
location /{
rewrite ^(.*)/archiver/((fid|tid)-[\w\-]+\.html)$ $1/archiver/index.php?$2 last;
rewrite ^(.*)/forum-([0-9]+)-([0-9]+)\.html$ $1/forumdisplay.php?fid=$2&page=$3 last;
rewrite ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/viewthread.php?tid=$2&extra=page%3D$4&page=$3 last;
rewrite ^(.*)/profile-(username|uid)-(.+)\.html$ $1/viewpro.php?$2=$3 last;
rewrite ^(.*)/space-(username|uid)-(.+)\.html$ $1/space.php?$2=$3 last;
rewrite ^(.*)/tag-(.+)\.html$ $1/tag.php?name=$2 last;
}