使用ISAPI_rewrite进行URL_Rewriting
-
05-07-2019 - |
题
我在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]
不隶属于 StackOverflow