使用IIS伪静态的方法

上海SEO2009-10-27 | 11:34分类:上海SEO案例, 上海SEO相关 | 标签: | 274 views

伪静态下iis上设置方法!

将其解压到任意目录,如: C:\Rewrite

打开“控制面板→管理工具→IIS信息服务管理器→网站→您的站点→属性”。在“ISAPI筛选器”项点击 “添加”, 筛选器名称填入Rewrite,可执行文件为C:\Rewrite\Rewrite.dll (如果您解压到其它目录请填入相应地址)

重新启动IIS.

看到状态为向上时成功。
2. 配置 httpd.ini
打开你的httpd.ini,找到

[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!官方提供的配置代码,注意正则格式。

3. 应用
比如,将read.php?bl_id=123&bu_id=456 伪静态成 /html/123/456.html

可以这样写:

RewriteRule ^(.*)/html/([0-9]+)/([0-9]+)\.html$ $1/read\.php\?bl_id=$2&bu_id=$3

上海SEO培训

您必须登录 后才能发表评论.

SEO 上海SEO公司 上海网站优化 上海SEO培训 沪ICP备06034546号 ©Copyright 2009 上海SEO