IIS 7.5 配置伪静态

给你一囗甜甜゛ 提交于 2019-11-27 20:43:17

长时间不弄伪静态了,刚花了1-2个小时研究弄了下

一、 iis安装 URLRewrite

下载地址:http://www.iis.net/download/URLRewrite 

二、

web.config 添加

<system.webServer>
<handlers>
<add name="html3" path="*" verb="*" type="System.Web.UI.PageHandlerFactory" resourceType="File" preCondition="integratedMode" />
<add name="html2" path="*" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" resourceType="File" requireAccess="None" preCondition="classicMode,runtimeVersionv4.0,bitness32" />
<add name="html" path="*.html" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" resourceType="File" preCondition="classicMode,runtimeVersionv4.0,bitness32" />
</handlers>

</system.webServer>

三、web.config添加映射规则

<system.webServer>

<rewrite>
<rules>
<rule name="Imported Rule 1">
<match url="^userinfo-([0-9]+)\.html$" ignoreCase="false" />
<action type="Rewrite" url="userinfo.aspx?userid={R:1}" appendQueryString="false" />
</rule>
</rewrite>
</system.webServer>

四、站点的应用程序池设置为经典模式

五、检查asp.net v4.0 isapi和cgi限制 (允许)

 

完工

 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!