iis7伪静态配置
时间:
阅读:147
iis7伪静态配置
最佳回答
web.conf配置文件的格式
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Imported Rule 1">
<match url="ShowProduct/([0-9]*).html"/>
<action type="Rewrite" url="/view.asp?id={R:1}" />
</rule>
<rule name="Imported Rule 2">
<match url="about_([0-9]*).html"/>
<action type="Rewrite" url="/about.asp?id={R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
配置web.config文件由其它规则导入时要调整的地方:
1、match语句最前面不需要加“/”如:
<match url="/ShowProduct/([0-9]*).html"/>
修改为:
<match url="ShowProduct/([0-9]*).html"/>(注:去掉了最前面“/”)
2、action语句内不要使用转义符号。如:
<action type="Rewrite" url="/view.asp?id={R:1}" />
修改为:
<action type="Rewrite" url="/view.asp?id={R:1}" />(注:去掉了“.”与“?”的转义符号)
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Imported Rule 1">
<match url="ShowProduct/([0-9]*).html"/>
<action type="Rewrite" url="/view.asp?id={R:1}" />
</rule>
<rule name="Imported Rule 2">
<match url="about_([0-9]*).html"/>
<action type="Rewrite" url="/about.asp?id={R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
配置web.config文件由其它规则导入时要调整的地方:
1、match语句最前面不需要加“/”如:
<match url="/ShowProduct/([0-9]*).html"/>
修改为:
<match url="ShowProduct/([0-9]*).html"/>(注:去掉了最前面“/”)
2、action语句内不要使用转义符号。如:
<action type="Rewrite" url="/view.asp?id={R:1}" />
修改为:
<action type="Rewrite" url="/view.asp?id={R:1}" />(注:去掉了“.”与“?”的转义符号)
最新回答共有2条回答
-
seo从业者
回复安装iis,这个就不多说了。使用系统自带的启动或关闭windows功能来安装。
,下载并安装“web 平台安装程序”,目前最新版本为5.0,双击,下一步到底即可。
打开Internet Information Services(IIS)管理器,在管理中已经多了一个“Web 平台安装程序”,双击打开。
搜索“url”,搜索结果第一个"URL 重写工具2.0",点击该记录后面的添加,再点击下方的安装按钮,还是一步到底,完成之后,重启下iis管理器。
iis管理器下发现多了一个“url重写”即安装成功了。接下来就是如何使用.htaccess文件了。找一个需要伪静态的项目,例如888,然后再双击“url重写”。
找到右侧菜单中的导入规则。
点击浏览,找到要使用的.htaccess文件,单击导入
步骤阅读
点击右侧的“应用”,重新项目888或者是iis,查看下伪静态规则是否生效。