投稿 评论 顶部

Intelligencia.UrlRewriter实现伪静态

佚名 网络安全

web.config


<?xml version="1.0"?><!--  有关如何配置 ASP.NET 应用程序的详细信息,请访问  http://go.microsoft.com/fwlink/?LinkId=169433  --><configuration>  <configSections>    <section name="rewriter" requirePermission="false" type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter"/>  </configSections>  <system.web>      <httpModules>      <add type="Intelligencia.UrlRewriter.RewriterHttpModule,Intelligencia.UrlRewriter" name="UrlRewriter"/>    </httpModules>    <compilation debug="true" targetFramework="4.0"/>    <authentication mode="Forms">      <forms loginUrl="~/Account/Login.aspx" timeout="2880"/>    </authentication>    <membership>      <providers>        <clear/>        <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/"/>      </providers>    </membership>    <profile>      <providers>        <clear/>        <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/>      </providers>    </profile>    <roleManager enabled="false">      <providers>        <clear/>        <add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/"/>        <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/"/>      </providers>    </roleManager>    <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>  </system.web>  <rewriter>    <rewrite url="~/index.html?(.+)" to="~/index.aspx?id=$1" processing="stop"/>    <rewrite url="~/test.html$" to="~/test.aspx?id=$1" processing="stop"/>  </rewriter>  <system.webServer>    <modules runAllManagedModulesForAllRequests="true"/>  </system.webServer></configuration>



项目中有一个Index.aspx页面


访问的网址跟<rewrite>里的规则 ??

http://localhost:16196/index.html

http://localhost:16196/index.html?15这样表示传递过来的id=15



发布到IIS5.0时,需要配置应用程序映射 ??


配置可以参考http://www.cnblogs.com/fiteg/