<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&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&Menu_ID=$2</SendTo>
</RewriterRule>
<RewriterRule>
<LookFor>~/wjTrade-(\d{1,6})-(\d{1,6})\.html</LookFor>
<SendTo>~/wjTrade.aspx?page=$1&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&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&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&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&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&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,我这样不能实现重写,我是不是漏了什么步骤?
解决方案 »
- 全文索引或模糊查询出来的结果 在Repeater分页按下一页就失效了
- GridView数据源问题
- 如何将服务器的文件复制的客户端
- public DateTime? Value .net里面这是一个什么方法
- 那位大侠帮帮忙,关于GridView固定标贴并且有横纵滚动条的问题
- 小菜求助:关于Textbox
- 快书揭帖的菜鸟问题:
- 页面的权限控制
- 究竟有没有用C#重定向框架的办法?100分,请各位多多赐教
- 请问各位这 两句话分别是什么意思?Dim i as int32 Dim tmpStr as String
- IIS 配置与 站点设置问题
- 大侠帮忙!.net读取Oracle数据库速度慢,看一下我的读取方法是否有问题!谢谢
其实只是问怎样用webconfig弄Rewriter而已,不知我漏了哪步?
<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>