<RewriterConfig>
    <Rules>
      <!-- 规则,可以使用正则表达式 -->
      <RewriterRule>
        <LookFor>~/wjTrade_(.[0-9]*)\.html</LookFor>
        <SendTo>~/wjTrade.aspx?Menu_ID=$1</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/wjNews_View_(.[0-9]*)\.html</LookFor>
        <SendTo>~/wjNews_View.aspx?n_ID=$1</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/wjNews_Class_(.[0-9]*)\.html</LookFor>
        <SendTo>~/wjNews_Class.aspx?Big_Id=$1</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/wjNews_Class_(\d{1,6})_(\d{1,6})\.html</LookFor>
        <SendTo>~/wjNews_Class.aspx?page=$1&amp;Big_Id=$2</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/wjNews_list_(\d{1,6})\.html</LookFor>
        <SendTo>~/wjNews_list.aspx?page=$1</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/wjNews_list.html</LookFor>
        <SendTo>~/wjNews_list.aspx</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/Default.html</LookFor>
        <SendTo>~/Default.aspx</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/wjShow_list_(\d{1,6})\.html</LookFor>
        <SendTo>~/wjShow_list.aspx?page=$1</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/wjShow_list.html</LookFor>
        <SendTo>~/wjShow_list.aspx</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/wjShow_View_(.[0-9]*)\.html</LookFor>
        <SendTo>~/wjShow_View.aspx?n_ID=$1</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/wjTrades_sClass_(.[0-9]*)\.html</LookFor>
        <SendTo>~/wjTrades_sClass.aspx?Menu_ID=$1</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/wjTrades_sClass_(\d{1,6})_(\d{1,6})\.html</LookFor>
        <SendTo>~/wjTrades_sClass.aspx?page=$1&amp;Menu_ID=$2</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/wjTrade-(\d{1,6})-(\d{1,6})\.html</LookFor>
        <SendTo>~/wjTrade.aspx?page=$1&amp;Menu_ID=$2</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/wjFind-buyers.html</LookFor>
        <SendTo>~/wjBuyer.aspx</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/wjFind-buyers_(\d{1,6})\.html</LookFor>
        <SendTo>~/wjBuyer.aspx?page=$1</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/wjFind-seller.html</LookFor>
        <SendTo>~/wjSale.aspx</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/wjFind-seller_(\d{1,6})\.html</LookFor>
        <SendTo>~/wjSale.aspx?page=$1</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/wjCompany.html</LookFor>
        <SendTo>~/wjEnterprise.aspx</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/wjCompany_(\d{1,6})\.html</LookFor>
        <SendTo>~/wjEnterprise.aspx?page=$1</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/wjProduct-all.html</LookFor>
        <SendTo>~/wjProduct.aspx</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/wjRecruitment.html</LookFor>
        <SendTo>~/wjRecruitment.aspx</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/wjProduct-all_(\d{1,6})\.html</LookFor>
        <SendTo>~/wjProduct.aspx?page=$1</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/Company/wjDetails-(\d{1,6})-(\d{1,6})\.html</LookFor>
        <SendTo>~/Company/productlook.aspx?p_id=$1&amp;u_id=$2</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/Company/Index-(\d{1,6}).html</LookFor>
        <SendTo>~/Company/index.aspx?p_UserID=$1</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/Company/contact-(\d{1,6}).html</LookFor>
        <SendTo>~/Company/contact.aspx?p_UserID=$1</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/Company/Product-(\d{1,6})-(\d{1,6})\.html</LookFor>
        <SendTo>~/Company/productlook.aspx?p_ID=$1&amp;p_UserID=$2</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/wjRecruitment-Show-(\d{1,6})\.html</LookFor>
        <SendTo>~/wjRecruitment_Show.aspx?j_ID=$1</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/wjRecruitment.html</LookFor>
        <SendTo>~/wjRecruitment.aspx</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/wj_Delivery.html</LookFor>
        <SendTo>~/wj_Delivery.aspx</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/wj_Delivery-Show-(\d{1,6})\.html</LookFor>
        <SendTo>~/wj_Delivery_Show.aspx?p_ID=$1</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/wjProduct-(\d{1,6})\.html</LookFor>
        <SendTo>~/wjProduct.aspx?Menu_ID=$1</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/wjProduct-(\d{1,6})-(\d{1,6})\.html</LookFor>
        <SendTo>~/wjProduct.aspx?page=$1&amp;Menu_ID=$2</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/wj_Delivery-(.[0-9]*)\.html</LookFor>
        <SendTo>~/wj_Delivery.aspx?Menu_ID=$1</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/wj_Delivery-(\d{1,6})-(\d{1,6})\.html</LookFor>
        <SendTo>~/wj_Delivery.aspx?page=$1&amp;Menu_ID=$2</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/Company/Index-(\d{1,6}).html</LookFor>
        <SendTo>~/Company/index.aspx?p_UserID=$1</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/Company/tradeal-(\d{1,6})-(\d{1,6})\.html</LookFor>
        <SendTo>~/Company/tradeal.aspx?p_id=$1&amp;p_UserID=$2</SendTo>
      </RewriterRule>
      <!--<RewriterRule>
        <LookFor>~/Company/tradeal-(\d{1,6})\.html</LookFor>
        <SendTo>~/Company/tradeal.aspx?p_UserID=$1</SendTo>
      </RewriterRule>-->
    </Rules>
  </RewriterConfig>
<system.web>
    <!--<pages buffer="true"/>--><!--页面缓冲-->
    <!--<sessionState mode="InProc" timeout="20"></sessionState>-->
    <customErrors mode="Off" />
    <pages validateRequest="false" >
    <controls>
      <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    </controls>
    </pages>
<!-- 
            设置 compilation debug="true" 将调试符号插入
            已编译的页面中。但由于这会 
            影响性能,因此只在开发过程中将此值 
            设置为 true。
        -->
<compilation debug="true">
   <buildProviders>
   <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.Common, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
   </buildProviders>
  </compilation>
这是webconfig里的部分代码,我只是写了webconfig,我这样不能实现重写,我是不是漏了什么步骤?

解决方案 »

  1.   

    没人知道吗?再顶..
    其实只是问怎样用webconfig弄Rewriter而已,不知我漏了哪步?
      

  2.   

    <configSections>
    <section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter"/>
    </configSections> <httpHandlers>
    <!-- URL重写配置的参数 -->
    <add verb="*" path="*.aspx" type="URLRewriter.RewriterFactoryHandler, URLRewriter"/>
    <!-- URL重写配置的参数 -->
    <remove verb="*" path="*.asmx"/>
    <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
    </httpHandlers>