繁体   English   中英

使用ISAPI_rewrite进行URL_Rewrite

[英]URL_Rewriting with ISAPI_rewrite

我在ISAPI_rewrite 3中遇到问题。

一个像这样的网址

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]

暂无
暂无

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

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