【问题标题】:URL_Rewriting with ISAPI_rewrite使用 ISAPI_rewrite 重写 URL_Rewrite
【发布时间】:2010-12-20 15:41:22
【问题描述】:

我在 ISAPI_rewrite 3 中遇到问题。

有一个类似的网址

www.example.com/web/index.html?ag=2154

我想要的是,当用户写这个地址时,它应该被转换为代理的子域,比如

www.2154.example.com/web/index.html?ag=2154

提前致谢

【问题讨论】:

    标签: iis url-rewriting url-routing isapi-rewrite


    【解决方案1】:

    您希望更改地址栏中的 URL,还是希望在“幕后”对其进行转换?请尝试任一

    RewriteBase /
    RewriteCond %{QUERY_STRING} ^ag=(\d+)$ [NC]
    RewriteRule ^web/index\.html$ http://www.%1.example.com%{REQUEST_URI} [NC,L]
    

    RewriteBase /
    RewriteCond %{QUERY_STRING} ^ag=(\d+)$ [NC]
    RewriteRule ^web/index\.html$ http://www.%1.example.com%{REQUEST_URI} [NC,P]
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2010-12-28
      • 1970-01-01
      • 1970-01-01
      • 2011-01-29
      • 1970-01-01
      • 2010-09-23
      • 1970-01-01
      相关资源
      最近更新 更多