0

我在 ISAPI_rewrite 3 中有问题。

有一个类似的网址

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

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

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

提前致谢

4

1 回答 1

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]
于 2009-11-27T11:10:09.687 回答