网络营销电子商务研究中心

网络营销电子商务研究中心 (https://www.0058.net/index.php)
-   服务器环境搭建 (https://www.0058.net/forumdisplay.php?f=5)
-   -   Iis服务器d4.1假静态全攻略 (https://www.0058.net/showthread.php?t=305)

sunshine 2006-03-14 09:37 PM

Iis服务器d4.1假静态全攻略
 
下载附件
如果你的 IIS 服务器加载过 Rewrite.dll 则可以不用下载。下载附件后亦可省略配置 httpd.ini 这一步骤,因为我已帮你设好了。

加载 Rewrite.dll
在 IIS 的 Isapi 上添加筛选器
筛选器名称为:re
可执行文件选择 Rewrite.dll 就可以了!
配置 httpd.ini
按照 Discuz!官方提供的配置代码,修改如下:

[ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
# Protect httpd.ini and httpd.parse.errors files
# from accessing through HTTP
RewriteRule ^(.*)/archiver/([a-z0-9\-]+\.html)$ $1/archiver/index\.php\?$2
RewriteRule ^(.*)/forum-([0-9]+)-([0-9]+)\.html$ $1/forumdisplay\.php\?fid=$2&page=$3
RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/viewthread\.php\?tid=$2&extra=page\%3D$4&page=$3
RewriteRule ^(.*)/profile-(username|uid)-(.+?)\.html$ $1/viewpro\.php\?$2=$3
*注:Discuz!官方提供的代码不能直接用于 IIS 服务器的配置,以上提供代码亦无需再修改。(当然,如果你是正则表达式高手,自然也可以自己编写配置 Rewrite 代码的。)

开启 URL 静态化
进入Discuz!4.1后台,Discuz!选项 - 论坛功能 - URL 静态化
按需要选择:

不启用 URL 静态化 功能。
Discuz! Archiver 静态化
当论坛启用 Archiver 功能时,Archiver 内的所有链接均采用 *.html 形式。
普通页面静态化
对论坛常用页面(如 forumdisplay.php、viewthread.php、viewpro.php 等)进行 URL 静态化转换。
Archiver 和普通页面均静态化
对 Archiver 以及论坛常用页面(如 forumdisplay.php、viewthread.php、viewpro.php 等)进行 URL 静态化转换。
完成
刷新你的首页,测试效果!


All times are GMT +8. The time now is 12:26 AM.

Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.