簡體   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