IIS 7.5 配置伪静态

长时间不弄伪静态了,刚花了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限制 (允许)

完工

猜你喜欢

转载自www.cnblogs.com/renzhituteng/p/11375713.html