伪静态web.config配置步骤
伪静态web.config配置步骤
发布时间:2016-12-29 来源:查字典编辑
摘要:复制代码代码如下:~/news/(.[0-9]*)/(.[d]*).html~/product/(.[d]*).zangdalei

复制代码 代码如下:

<?xml version="1.0" encoding="UTF-8"?>

<configuration>

<>

<configSections>

<section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter" />

</configSections>

<>

<RewriterConfig>

<>

<Rules>

<>

<RewriterRule>

<>

<SendTo><![CDATA[~/news.aspx?id=$1&pid=$2]]></SendTo>

<>

<LookFor>~/news/(.[0-9]*)/(.[d]*).html</LookFor>

</RewriterRule>

<RewriterRule>

<>

<SendTo><![CDATA[~/product.aspx?pid=$1]]></SendTo>

<>

<LookFor>~/product/(.[d]*).zangdalei</LookFor>

</RewriterRule>

</Rules>

</RewriterConfig>

<system.web>

<compilation debug="false" targetFramework="4.0">

<>

<buildProviders>

<add extension=".html" type="System.Web.Compilation.PageBuildProvider" />

</buildProviders>

</compilation>

<>

<httpHandlers>

<add verb="*" path="*.html" type="URLRewriter.RewriterFactoryHandler, URLRewriter" />

<add verb="*" path="*.zangdalei" type="URLRewriter.RewriterFactoryHandler, URLRewriter" />

</httpHandlers>

</system.web>

<system.webServer>

<handlers>

<add name="aspnethtml" path="*.html" verb="GET,POST" modules="IsapiModule" scriptProcessor="C:WindowsMicrosoft.NETFrameworkv4.0.30319aspnet_isapi.dll" resourceType="Unspecified" preCondition="classicMode,runtimeVersionv4.0,bitness32" />

<add name="aspnetzangdalei" path="*.zangdalei" verb="GET,POST" modules="IsapiModule" scriptProcessor="C:WindowsMicrosoft.NETFrameworkv4.0.30319aspnet_isapi.dll" resourceType="Unspecified" preCondition="classicMode,runtimeVersionv4.0,bitness32" />

</handlers>

<defaultDocument>

<files>

<clear />

<add value="default.aspx" />

<add value="default.html" />

</files>

</defaultDocument>

</system.webServer>

</configuration>

推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
相关阅读
网友关注
最新asp.net教程学习
热门asp.net教程学习
编程开发子分类