郁闷~Url重写一整天都实现不了
废话不多说,如下:
我想要的:http:xxx.xxx.com/beijing
http:xxx.xxx.com/shanghai
实现为http:xxx.xxx.com/home.aspx?city=beijing
我的config方式是:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter" />
</configSections>
<RewriterConfig>
<Rules>
<!-- Rules for Blog Content Displayer -->
<RewriterRule>
<LookFor>http:xxx.xxx.com//(\w+)(/?)(\w+)* </LookFor>
<SendTo>~/home.aspx?city=$1 </SendTo>
</RewriterRule>
</RewriterConfig>
<system.web>
<httpModules>
<add type="URLRewriter.ModuleRewriter, URLRewriter" name="ModuleRewriter" />
</httpModules></configuration>
我的测试结果是:
无法找到资源。
说明: HTTP 404。您正在查找的资源(或者它的一个依赖项)可能已被移除,或其名称已更改,或暂时不可用。请检查以下 URL 并确保其拼写正确。
请求的 URL: /beijing
哪位高手慷慨解囊,不吝赐教~~~感谢!!!
疑问,是不是无法以/city这种方式实现url重写?还是我的配置那块儿出了问题?唉,郁闷~~~