本主題是適用有獨立主機權限的,從DZ轉換過來的用戶
轉換前是像這樣的:
archiver/fid-79-page-1.html
forum-136-1.html
thread-1401-1-1.html
forumdisplay.php?fid=6
viewthread.php?tid=124336
轉換后都能實現
請先做一下步驟:
把thread.php復制一份改名為forumdisplay.php
把read.php復制一份改名為viewthread.php
這樣省事省時,保證動態地址訪問正常,接下去開始偽靜態重寫規則
這兩步還是做了比較好,無論有沒權限都好做的
IIS的規則和Apache稍有不同
httpd.ini中代碼如下,復制粘帖即可
[ISAPI_Rewrite]
# Defend your computer from some worm attacks
RewriteRule .*(?:global.asa|default/.ida|root/.exe|/./.).* . [F,I,O]
RewriteRule ^(.*)/archiver/ /simple/ [R]
RewriteRule ^(.*)/fid-(/d+)/.html /simple/index.php/?f$2.html [R]
RewriteRule ^(.*)/fid-(/d+)-page-1.html /simple/index.php/?f$2.html [R]
RewriteRule ^(.*)/tid-(/d+)-page-1.html /simple/index.php/?t$2.html [R]
RewriteRule ^(.*)thread-(/d+)-(/d+)-(/d+)/.html $1/read.php?tid=$2
RewriteRule ^(.*)forum-(/d+)-(/d+)/.html $1/thread.php?fid=$2
RewriteRule ^(.*)-htm-(.*)$ $1.php?$2
RewriteRule ^(.*)/simple/([a-z0-9/_]+/.html)$ $1/simple/index.php?$2
研究過程中服務器的iis就是不聽使喚,亂套規則,
然后請來了技術重裝了Rewrite模塊,之后就好啦!
如果IIS沒有安裝ISAPI篩選器 請看教程:http://www.phpwind.net/read.php?tid=671630
如果IIS的重寫出現問題,可以參考此帖的做法,
我的IIS下設置靜態目錄的方法http://www.phpwind.net/read-htm-tid-166136.html
重新安裝一下ISAPI篩選器
如果您發現以上不適用,可以參考此帖
解除轉換后的流量丟失之――全面Rewrite規則http://www.phpwind.net/read-htm-tid-636480.html
無獨立服務器權限的話
把thread.php復制一份改名為forumdisplay.php
把read.php復制一份改名為viewthread.php
這樣省事省時,保證動態地址訪問正常
新聞熱點
疑難解答
圖片精選