Iis URL_重写与ISAPI_重写

Iis URL_重写与ISAPI_重写,iis,url-rewriting,url-routing,isapi-rewrite,Iis,Url Rewriting,Url Routing,Isapi Rewrite,我在ISAPI_重写3中遇到问题 a有一个类似的url www.example.com/web/index.html?ag=2154 我想要的是,当用户写入这个地址时,它应该被转换成代理的子域,就像 www.2154.example.com/web/index.html?ag=2154 提前感谢您想更改地址栏中的URL还是想在“幕后”将其转换?请两个都试试 RewriteBase / RewriteCond %{QUERY_STRING} ^ag=(\d+)$ [NC] RewriteRule

我在ISAPI_重写3中遇到问题

a有一个类似的url

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

我想要的是,当用户写入这个地址时,它应该被转换成代理的子域,就像

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


提前感谢

您想更改地址栏中的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]