国内最全IT社区平台 联系我们 | 收藏本站
华晨云阿里云优惠2
您当前位置:首页 > php开源 > Discuz > Win主机伪静态httpd.ini文件DZ、PW论坛

Win主机伪静态httpd.ini文件DZ、PW论坛

来源:程序员人生   发布时间:2013-12-01 19:05:04 阅读次数:2831次

我的是虚拟空间,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
生活不易,码农辛苦
如果您觉得本网站对您的学习有所帮助,可以手机扫描二维码进行捐赠
程序员人生
------分隔线----------------------------
分享到:
------分隔线----------------------------
为码而活
积分:4237
15粉丝
7关注
栏目热点
关闭
程序员人生