【问题标题】:Url Rewrite - regular Expression in IISUrl Rewrite - IIS 中的正则表达式
【发布时间】:2015-12-12 16:48:43
【问题描述】:

我有一个网址
www.example.com/test.aspx?n=quick-brown-fox-jumps-over-the--lazy-dog-2890

我想把它显示为
www.example.com/test/quick-brown-fox-jumps-over-the--lazy-dog/2890

使用 URL 重写正则表达式

请帮忙

【问题讨论】:

    标签: regex iis iis-7 iis-7.5


    【解决方案1】:

    试试这个:

    RewriteEngine On
    RewriteRule /test/(.+)/(.+) /test.aspx?n=$1-$2 [QSA] 
    

    【讨论】:

    • 之后必须重新加载或重新启动服务器,你这样做了吗?我刚刚在我的服务器(在本地)上尝试过它,它可以工作。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-10
    • 2015-10-02
    • 2018-12-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多