比如网址是123.abc.com/web/123/index.html   (其中:“web/123/”  这两个都是可变化的)
如何实现:123.abc.com/index.html?
谢谢各位了

解决方案 »

  1.   

    这样试试<RewriterConfig>
       <Rules>
          <RewriterRule>
             <LookFor>(123.abc.com).*(/[^/]*)</LookFor>
             <SendTo>$1$2</SendTo>
          </RewriterRule>
       </Rules>
    </RewriterConfig>
      

  2.   

    前面几个符号忘了转义了<RewriterConfig>
       <Rules>
          <RewriterRule>
             <LookFor>(123\.abc\.com).*(/[^/]*)</LookFor>
             <SendTo>$1$2</SendTo>
          </RewriterRule>
       </Rules>
    </RewriterConfig>
      

  3.   

    这个代码是放在 Web.Config  里面吗?
      

  4.   

    如果跳转的页面少,使用ASP.NET2.0新特性:Url映射(无须下载组件)
    (地址栏显示的是123.abc.com/index.html,其实是123.abc.com/web/123/index.html)
    <system.web>
        <urlMappings>
          <add url="~/123.abc.com/index.html" mappedUrl="~/123.abc.com/web/123/index.html"/>
        </urlMappings>
    </system.web>
      

  5.   

    那就用二楼的方法,Url重写,需下载URLRewriter组件,它支持正则表达式,功能强大