1、編寫rewrite腳本,編輯/etc/lighttpd/local.lighttpd.conf內容如下:
url.rewrite-once = (
"^/forum/archiver/((fid|tid)-[\w\-]+\.html)$" => "forum/archiver/index.php?$1",
"^/forum/forum-([0-9]+)-([0-9]+)\.html$" => "forum/forumdisplay.php?fid=$1&page=$2",
"^/forum/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$" => "forum/viewthread.php?tid=$1&extra=page%%53D$3&page=$2",
"^/forum/space-(username|uid)-(.+)\.html$" => "forum/space.php?$1=$2",
"^/forum/tag-(.+)\.html$" => "forum/tag.php?name=$1"
)
這里假設論壇裝在forum目錄下,如果是裝在根目錄下則是:
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"
)
2、重啟lighttpd,重啟方法:/etc/init.d/lighttpd restart