我在ISAPI_rewrite 3中遇到问题。

有一个像

的网址

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

我想要的是,当用户写入此地址时,应将其转换为代理的子域,如

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

提前致谢

有帮助吗?

解决方案

您是否希望更改地址栏中的网址,或者是否希望将其转换为“幕后”?请尝试

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]
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top