Windows2008中IIS7.5为网站设置伪静态映射配置方法
网上有很多IIS设置伪静态映射配置方法,但配置繁琐,其实主要设置这二点就可以了。
一、IIS中设置好网站后自动会生成一个应该程序池,设置如下

IIS应用程序池设置

应用程序池高级设置
二、配置web.config 文件,增加以下节点
1、
<RewriterConfig>
<Rules>
<RewriterRule>
<LookFor>~/testone_(\d+).html</LookFor>
<SendTo>~/test1.aspx?id=$1</SendTo>
</RewriterRule>
<RewriterRule>
<LookFor>~/test_(\d+).html</LookFor>
<SendTo>~/test.aspx?id=$1</SendTo>
</RewriterRule>
</Rules>
</RewriterConfig>

web.config中映射规则设置
2、
<system.webServer>
<handlers>
<add name="Html-Integrate" path="*" verb="*" type="System.Web.UI.PageHandlerFactory" resourceType="Unspecified" preCondition="integratedMode"/>
<add name="all" path="*" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="None" preCondition="classicMode,runtimeVersionv4.0,bitness64"/>
<add name="html" path=".html" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv4.0,bitness64"/>
</handlers>
<modules>
<add name="all" type="URLRewriter.ModuleRewriter" preCondition="managedHandler"/>
</modules>
</system.webServer>

在web.config中添加脚本映射代码
保存后,运行网站即可,比如你以前访问网站为:
http://www.23991818.com/test.aspx?id=111
伪静态配置成功后,你可以这样访问:
http://www.23991818.com/test_111.html
这样就完成了,以上可以根据你 .netframwork版本号灵活定制,非常方便!