asp.net url重写问题,麻烦高手帮忙!在线等待
首先,我要求的URL重写方法,只须要在Web.Config里配置就行的那种方法,不在IIS中配置,因为我买的空间,我不能配置IIS(郁闷)http://www.csdn....
首先,我要求的URL重写方法,只须要在Web.Config里配置就行的那种方法,不在IIS中配置,因为我买的空间,我不能配置IIS(郁闷)
http://www.csdn.com/news.aspx?id=1
http://www.csdn.com/newsinfo.aspx?id=1&classid=2
就想重写,这样的类型的
在网上搜索了下,按他们的步骤整理下,可是还是不行,这个我也下了URLRewriter,可是还是不行
我找的代码如下:
<configuration>
<configSections>
<section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter" />
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
</sectionGroup>
</configSections>
<RewriterConfig>
<Rules>
<RewriterRule>
<LookFor>~/news.(\d*)\.aspx </LookFor>
<SendTo>~/news.aspx?id=$1 </SendTo>
</RewriterRule>
<RewriterRule>
<LookFor>~/newsinfo.(\d*)\.(\d*)\.aspx </LookFor>
<SendTo>~/newsinfo.aspx?id=$1&classid=$2 </SendTo>
</RewriterRule>
</Rules>
</RewriterConfig>
<system.web>
<httpHandlers>
<add verb="*" path="*.aspx" type="URLRewriter.RewriterFactoryHandler, URLRewriter" />
</httpHandlers>
<compilation debug="true">
<assemblies>
<add assembly="System.Management, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> </assemblies> </compilation>
<authentication mode="Windows"/>
</system.web>
</configuration>
请高手帮忙,谢谢!在线等待!
http://www.csdn.com/news.aspx?id=1
http://www.csdn.com/newsinfo.aspx?id=1&classid=2
重写成
http://www.csdn.com/news.1.aspx
http://www.csdn.com/newsinfo.1.2.aspx
就行 展开
http://www.csdn.com/news.aspx?id=1
http://www.csdn.com/newsinfo.aspx?id=1&classid=2
就想重写,这样的类型的
在网上搜索了下,按他们的步骤整理下,可是还是不行,这个我也下了URLRewriter,可是还是不行
我找的代码如下:
<configuration>
<configSections>
<section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter" />
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
</sectionGroup>
</configSections>
<RewriterConfig>
<Rules>
<RewriterRule>
<LookFor>~/news.(\d*)\.aspx </LookFor>
<SendTo>~/news.aspx?id=$1 </SendTo>
</RewriterRule>
<RewriterRule>
<LookFor>~/newsinfo.(\d*)\.(\d*)\.aspx </LookFor>
<SendTo>~/newsinfo.aspx?id=$1&classid=$2 </SendTo>
</RewriterRule>
</Rules>
</RewriterConfig>
<system.web>
<httpHandlers>
<add verb="*" path="*.aspx" type="URLRewriter.RewriterFactoryHandler, URLRewriter" />
</httpHandlers>
<compilation debug="true">
<assemblies>
<add assembly="System.Management, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> </assemblies> </compilation>
<authentication mode="Windows"/>
</system.web>
</configuration>
请高手帮忙,谢谢!在线等待!
http://www.csdn.com/news.aspx?id=1
http://www.csdn.com/newsinfo.aspx?id=1&classid=2
重写成
http://www.csdn.com/news.1.aspx
http://www.csdn.com/newsinfo.1.2.aspx
就行 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询