url重写

<?xml version="1.0"?>
<configuration>
 <configSections>
  <section name="rewriter" type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter"/>
 </configSections>
 <appSettings>
  <add key="site" value="hb"/>
  <add key="csite" value="湖北"/>
 </appSettings>
 <connectionStrings/>
 <system.web>
  <compilation defaultLanguage="c#" debug="true">
   <assemblies>
    <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
   </assemblies>
  </compilation>
  <customErrors mode="Off"/>
  <globalization requestEncoding="gb2312" responseEncoding="gb2312"/>
  <!--UrlRewriter-->
  <httpModules>
   <add type="Intelligencia.UrlRewriter.RewriterHttpModule, Intelligencia.UrlRewriter" name="UrlRewriter"/>
  </httpModules>
 </system.web>
 <!--UrlRewriter-->
 <rewriter>
  <!--UrlRewriter viewpage-->
  <rewrite url="/zs/([0-9]+)/" to="/view_zs.aspx?id=$1"/>
  <rewrite url="/vip/([0-9]+)/" to="/view_zs.aspx?id=$1"/>
  <rewrite url="/dl/([0-9]+)/" to="/view_dl.aspx?id=$1"/>
  <rewrite url="/zb/([0-9]+)/" to="/view_zb.aspx?id=$1"/>
  <!--UrlRewriter regpage-->
  <rewrite url="/Register/" to="/reg.aspx"/>
  <!--UrlRewriter listpage-->
  <rewrite url="/(.+)list/([0-9]+)/" to="/$1_list.aspx?CurrentPage=$2"/>
  <rewrite url="/(.+)list/Search/([0-9]+)/(.+)/(.+)/" to="/$1_list.aspx?act=Search&amp;stid=$2&amp;stypes=$3&amp;skey=$4"/>
  <rewrite url="/(.+)list/Search/" to="/$1_list.aspx?act=Search"/>
  <rewrite url="/(.+)list/q/([0-9]+)/(.+)/(.+)/" to="/$1_list.aspx?action=q&amp;qbigtypes=$2&amp;qtypes=$3&amp;qkey=$4"/>
  <rewrite url="/(.+)list/q/(.+)/(.+)/" to="/$1_list.aspx?action=q&amp;qtypes=$2&amp;qkey=$3"/>
  <rewrite url="/(.+)list/City/([0-9]+)/" to="/$1_list.aspx?action=City&amp;CityId=$2"/>
  <rewrite url="/(.+)list/" to="/$1_list.aspx"/>
 </rewriter>
</configuration>
posted @ 2011-04-02 10:25  洗碗心得  阅读(216)  评论(0编辑  收藏  举报