/Corporation/Templates/index.aspx?ID=783 
/Corporation/Templates/index/783.html RewriteRule /Corporation/Templates/index/\d{1,})\.html /Corporation/Templates/index.aspx?ID=$1

解决方案 »

  1.   

     [N,I],[F,I,O] 
    是什么意思
      

  2.   

    想不出一步到位的
    @"([\?&][^\d]+)([\d]+)";
    用这个正则
    然后replace时替换成这个"/$2.html"
    最后如果是
    如果是两个以上参数,则需要再写个正则...
    或者执行完这个再replace一遍
      

  3.   

    如果你有iis的设置权限,可以试试我们的devmsIISTools.
    我的资源里有下载.
    有需的话,我可以写对应的正则给你.
      

  4.   

    我的网站也是用它来重写的.比如:
    http://www.vcsale.com/service.World_of_Warcraft_EU.8.aspx
    实际地址是:
    http://www.vcsale.com/serviceselect.aspx?gameid=8
      

  5.   

    http://www.aaa.com/Corporation/Templates/index.aspx?ID=783 
    改写成 
    http://www.aaa.com/Corporation/Templates/index/783.html ----------------------------------
          <RewriterRule>
            <LookFor>~/Corporation/Corporation/index/(\d{1,8})\.html</LookFor>
            <SendTo>~/www.aaa.com/Corporation/Templates/index.aspx?ID=$1</SendTo>
          </RewriterRule>
    ----------------------------------http://www.aaa.com/Training/Detail.aspx?ID=81&PID=156 
    改写成 
    http://www.aaa.com/Training/Detail/81_156.html ----------------------------------
          <RewriterRule>
            <LookFor>~/Training/Detail/(\d{1,8})_(\d{1,8})\.html</LookFor>
            <SendTo>~/www.aaa.com/Training/detail.aspx?ID=$1&PID=156</SendTo>
          </RewriterRule>
    ----------------------------------
    http://www.aaa.com/tutor/detail.aspx?ID=209 
    改写成 
    http://www.aaa.com/tutor/detail/209.html 
    ----------------------------------
          <RewriterRule>
            <LookFor>~/tutor/Detail/(\d{1,8})\.html</LookFor>
            <SendTo>~/www.aaa.com/tutor/detail.aspx?ID=$1
          </RewriterRule>
    ----------------------------------http://www.aaa.com/shop/Shop-pro.aspx?productID=2536 
    改写成 
    http://www.aaa.com/shop/Shop-pro/2536.html ----------------------------------
          <RewriterRule>
            <LookFor>~/shop/shop-pro/(\d{1,8})\.html</LookFor>
            <SendTo>~/shop/Shop-pro.aspx?productID=$1
          </RewriterRule>
    ----------------------------------试试看..比较容易理解的
      

  6.   

    晕,1-3个都写错了点你把 sendto下的 www.aaa.com/ 去掉
      

  7.   

    11楼 把 1-3个   sendto下的   www.aaa.com/   去掉就完成正确了
      

  8.   

    happy
    happy
    欢迎大家来群里聊聊天....学习,,,研究....C# / .Net 7729746 交流社团 聊技术,项目合作。Blogs http://zhoufleru.cnblogs.com    
      

  9.   


      正则如下:
        http://\S+/\w+\S+?\.aspx\?((ID=\d+\&PID=\d+)|(ID=\d+)|(productID=\d+))
      

  10.   

    httpd.ini
    [ISAPI_Rewrite] 
    #   3600   =   1   hour 
    CacheClockRate   3600 RepeatLimit   32 #   Protect   httpd.ini   and   httpd.parse.errors   files 
    #   from   accessing   through   HTTP 
    RewriteRule   ^/httpd(?:\.ini|\.parse\.errors).*   [F,I,O] 
    RewriteRule   /content/(\d+)\.html   /content\.asp\?sort=$1   [N,I] 
    #下面是新增加的规则#/Corporation/Templates/index/783.html ==>/Corporation/Templates/index.aspx?ID=783
    RewriteRule /Corporation/Templates/index/(\d+)\.html  /Corporation/Templates/index\.aspx\?ID=$1#/Training/Detail/81_156.html ==>/Training/Detail.aspx?ID=81&PID=156
    RewriteRule /Training/Detail/(\d+)_(\d+)\.html /Training/Detail\.aspx\?ID=$1&PID=$2#/tutor/detail/209.html ==>/tutor/detail.aspx?ID=209
    RewriteRule /tutor/detail/(\d+)\.html /tutor/detail\.aspx\?ID=$1#/shop/Shop-pro/2536.html ==>/shop/Shop-pro.aspx?productID=2536 
    RewriteRule /shop/Shop-pro/(\d+)\.html /shop/Shop-pro\.aspx\?productID=$1
      

  11.   

    各位高手,我现在想改写如下 http://www.kh-audio.com/e-product.asp?producttype=Electronics 
    改写成 
    http://www.kh-audio.com/e-product_electronics.htmlhttp://www.kh-audio.com/e-product.asp?producttype=Amplifier%20Kits
    改写成 
    http://www.kh-audio.com/e-product_amp.htmlhttp://www.kh-audio.com/e-productinfo.asp?id=1330
    改写成:
    http://www.kh-audio.com/e-productinfo_1330.htmlhttpd.ini中默认内容如下 [ISAPI_Rewrite]# 3600 = 1 hour
    CacheClockRate 3600RepeatLimit 32# Protect httpd.ini and httpd.parse.errors files
    # from accessing through HTTP