godaddy的windows主機(jī)中discuz7.x 的偽靜態(tài)設(shè)置
前一段時(shí)間買了一個(gè)godaddy的windows主機(jī),并選擇了IIS7.在主機(jī)偵探論壇上發(fā)現(xiàn),竟然還支持 url rewrite, 這樣就可以設(shè)置discuz的偽靜態(tài)了.同時(shí)也在論壇里找到了偽靜態(tài)代碼.
不同于linux主機(jī)的是, windows主機(jī)安裝discuz程序 要實(shí)現(xiàn)偽靜態(tài)不能使用.htaccess文件,而是需要在web.config文件,在文件里寫上原本對(duì)應(yīng)于linux主機(jī)的.htaccess文件代碼.
把下面的內(nèi)容保存成web.config 并傳到bbs目錄下 ,并在后臺(tái)啟用靜態(tài)化.
GoDaddy windows主機(jī)discuz偽靜態(tài)代碼如下:
<?xml version=”1.0″ encoding=”UTF-8″?><configuration><system.webServer><rewrite><rules><rule name=”Imported Rule 17″><match url=”^archiver/((fid|tid)-[\w\-]+\.html)$” ignoreCase=”false” /><action type=”Rewrite” url=”archiver/index.php?{R:1}” appendQueryString=”false” /></rule><rule name=”Imported Rule 18″><match url=”^forum-([0-9]+)-([0-9]+)\.html$” ignoreCase=”false” /><action type=”Rewrite” url=”forumdisplay.php?fid={R:1}&page={R:2}” appendQueryString=”false” /></rule><rule name=”Imported Rule 19″><match url=”^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$” ignoreCase=”false” /><action type=”Rewrite” url=”viewthread.php?tid={R:1}&extra=page\%3D{R:3}&page={R:2}” appendQueryString=”false” /></rule><rule name=”Imported Rule 20″><match url=”^space-(username|uid)-(.+)\.html$” ignoreCase=”false” /><action type=”Rewrite” url=”space.php?{R:1}={R:2}” appendQueryString=”false” /></rule><rule name=”Imported Rule 21″><match url=”^tag-(.+)\.html$” ignoreCase=”false” /><action type=”Rewrite” url=”tag.php?name={R:1}” appendQueryString=”false” /></rule></rules></rewrite><httpErrors errorMode=”Detailed” /><asp scriptErrorSentToBrowser=”true” /></system.webServer><system.web><customErrors mode=”O(jiān)ff” /><globalization requestEncoding=”utf-8″ responseEncoding=”utf-8″ fileEncoding=”utf-8″ /></system.web></configuration>