# Protect httpd.ini and httpd.parse.errors files
# from accessing through HTTP
RewriteRule ^(.*)/archiver/((fid|tid)-[\w\-]+\.html)\?*(.*)$ $1/archiver/index\.php\?$2&$4
RewriteRule ^(.*)/forum-([0-9]+)-([0-9]+)\.html\?*(.*)$ $1/forumdisplay\.php\?fid=$2&page=$3&$4
RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html\?*(.*)$ $1/viewthread\.php\?tid=$2&extra=page\%3D$4&page=$3&$4
RewriteRule ^(.*)/space-(username|uid)-(.+)\.html\?*(.*)$ $1/space\.php\?$2=$3&$4
RewriteRule ^(.*)/tag-(.+)\.html\?*(.*)$ $1/tag\.php\?name=$2&$3
然后进入论坛系统设置的搜索引擎优化,根据需要开启 URL 静态化功能。
四、Zeus Web Server
在虚拟主机配置中找到 Request Rewriting,在 Rewrite Script 中写入以下内容,然后 Apply changes 并 make it take effect。
match URL into $ with ^(.*)/archiver/((fid|tid)-[\w\-]+\.html)?*(.*)$
if matched then
set URL = $1/archiver/index.php?$2&$4
endif
match URL into $ with ^(.*)/forum-([0-9]+)-([0-9]+)\.html?*(.*)$
if matched then
set URL = $1/forumdisplay.php?fid=$2&page=$3&$4
endif
match URL into $ with ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html?*(.*)$
if matched then
set URL = $1/viewthread.php?tid=$2&extra=page\%3D$4&page=$3&$4
endif
match URL into $ with ^(.*)/space-(username|uid)-(.+?)\.html?*(.*)$
if matched then
set URL = $1/space.php?$2=$3&$4
endif
match URL into $ with ^(.*)/tag-(.+?)\.html?*(.*)$
if matched then
set URL = $1/tag.php?name=$2$3
endif