- 时间:2021-07-30 11:25 编辑: 来源: 阅读:
- 扫一扫,手机访问
摘要:如何在IIS环境下配置Rewrite规则 图文
URL 静态化可以提高搜索引擎抓取,开启本功能需要对 Web 服务器增加相应的 Rewrite 规则,且会轻微增加服务器负担。本教程讲解如何在 IIS 环境下配置各个产品的 Rewrite 规则。
[b]一、首先下载 Rewrite.zip 的包,解压到任意盘上的任意目录。[/b]
各个产品的 Rewrite 规则包不同,请选择对应的产品下载对应的 Rewrite 规则。
Discuz!6.0.0/6.1.0 的 Rewrite 规则下载地址:[url=http://www.discuz.net/attachment.php?aid=NjQzMTIwfDg2MjBkYjVjfDEyNjM0NDc1MjF8OTcxYTloRlhtNDVwRXJZZDdFU3B5M1JpMjBDMWJPRG5keGJpalIxQXM0Ky95Y2s%3D][/url][url=http://faq.comsenz.com/batch.download.php?aid=3884]Rewrite.zip[/url]
UCenter Home1.0.0 的 Rewrite规则下载地址:[url=http://faq.comsenz.com/batch.download.php?aid=3885]Rewrite.zip[/url]
SupeSite6.0_X-Space4.0_UC 的Rewrite 规则下载地址:[url=http://faq.comsenz.com/batch.download.php?aid=3886]iisrewrite.zip[/url]
SupeV 的 Rewrite 规则下载地址:[url=http://faq.comsenz.com/batch.download.php?aid=3887]rewrite_iis.zip[/url]
下载各个产品的 Rewrite 规则并且重命名后如下图所示存放:
[url=http://faq.comsenz.com/batch.download.php?aid=37][img]http://files.jb51.net/file_images/article/201108/2011080722344230.gif[/img]
[/url]
[b]二、配置方法[/b]
Discuz!、UCHome、SupeSite/X-Space、SupeV 的 Rewrite 配置方法类似,下面以 Discuz!6.0.0/6.1.0 的 Rewrite 规则配置方法为例讲解如何在 IIS 环境下配置 Rewrite 规则。
在 IIS 管理器里选择网站,右键选择“属性”,如下图所示:
[url=http://faq.comsenz.com/batch.download.php?aid=38][img]http://files.jb51.net/file_images/article/201108/2011080722344231.gif[/img]
[/url]
在弹出的窗口里选择“ISAPI筛选器”
[url=http://faq.comsenz.com/batch.download.php?aid=39][img]http://files.jb51.net/file_images/article/201108/2011080722344232.gif[/img]
[/url]
上图中点击“添加”,在弹出的窗口里“筛选器名称”填写“rewrite”
[url=http://faq.comsenz.com/batch.download.php?aid=40][img]http://files.jb51.net/file_images/article/201108/2011080722344233.gif[/img]
[/url]
上图界面中点击“浏览”,选择下载解压后的 Discuz! Rewrite 规则目录下的 Rewrite.dll 文件
[url=http://faq.comsenz.com/batch.download.php?aid=41][img]http://files.jb51.net/file_images/article/201108/2011080722344234.gif[/img]
[/url]
浏览完毕点击“确定”
[url=http://faq.comsenz.com/batch.download.php?aid=42][img]http://files.jb51.net/file_images/article/201108/2011080722344235.gif[/img]
[/url]
添加完毕点击“确定”
[url=http://faq.comsenz.com/batch.download.php?aid=43][img]http://files.jb51.net/file_images/article/201108/2011080722344236.gif[/img]
[/url]
重新启动 IIS
[url=http://faq.comsenz.com/batch.download.php?aid=44][img]http://files.jb51.net/file_images/article/201108/2011080722344237.gif[/img]
[/url]
[url=http://faq.comsenz.com/batch.download.php?aid=45][img]http://files.jb51.net/file_images/article/201108/2011080722344238.gif[/img]
[/url]
重新选择该站点 => 右键“属性”=> “ISAPI 筛选器”,如果看到状态为向上的绿色箭头,就说明 Rewrite 模块安装成功了。
[url=http://faq.comsenz.com/batch.download.php?aid=46][img]http://files.jb51.net/file_images/article/201108/2011080722344239.gif[/img]
[/url]
Rewrite 规则配置成功了,但是这个时候浏览论坛地址依旧不是伪静态的,还需要到论坛后台做相应的设置才可以。