简体   繁体   English

使用ISAPI_rewrite进行URL_Rewrite

[英]URL_Rewriting with ISAPI_rewrite

I have a problem in ISAPI_rewrite 3. 我在ISAPI_rewrite 3中遇到问题。

a have a url like 一个像这样的网址

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

What I want is, when the user writes this address it should be converted to agent's subdomain like 我想要的是,当用户写入此地址时,应将其转换为代理的子域,例如

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

Thanks in advance 提前致谢

Do you want the URL in the address bar to change or do you want it to be converted "behind the scenes"? 您是否要更改地址栏中的URL,还是要“在幕后”将其转换? Please try either 请尝试

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

or 要么

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM