开发者

URL_Rewriting with ISAPI_rewrite

开发者 https://www.devze.com 2022-12-13 02:01 出处:网络
I have a problem in ISAPI_rewrite 3. a have a url like 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

I have a problem in ISAPI_rewrite 3.

a have a url like

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

Thanks i开发者_开发知识库n advance


Do you want the URL in the address bar to change or do you want it to be converted "behind the scenes"? 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]
0

精彩评论

暂无评论...
验证码 换一张
取 消