Win主機偽靜態httpd.ini文件DZ、PW論壇
來源:程序員人生 發布時間:2013-12-01 19:05:04 閱讀次數:3241次
我的是虛擬空間,win 2003 SP服務器,嘗試了論壇上提供的.htaccess文件、web.config.ini文件和httpd.ini文件都失敗了。
后來求助空間商,給了我一個httpd.ini文件才終于成功生產偽靜態。
現在拿出來分享一下,也許適合你的空間使用,但前提是你的空間有組件支持rewrite哦。
還包括了PhpWind生成偽靜態的規則哦。將上面代碼復制到記事本保存為httpd.ini文件,然后上傳到你的空間的根目錄下就OK了(記得是根目錄哦,你安裝的即使是在子目錄下httpd.ini文件也要放到根目錄里,我試了只在根目錄下可行)。
[ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
# Protect httpd.ini and httpd.parse.errors files
# from accessing through HTTP
# Discuz Rewrite規則
RewriteRule ^(.*)/archiver/((fid|tid)-[0-9]+.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
# PhpWind Rewrite規則
RewriteRule ^(.*)-htm-(.*)$ $1.php?$2
RewriteRule ^(.*)/simple/([a-z0-9\_]+.html)$ $1/simple/index.php?$2