簡體   English   中英

使用相同的查詢字符串重定向到相同域中的另一個文件夾

[英]redirect to another folder in same domain with same query string

我想將用戶重定向到同一域中的其他目錄,但url中的查詢字符串需要保留。

例如,當用戶點擊

 http://selfservice.mycompany.com/Directory1/UpdateUser.aspx?CASE_ID=00001 

他必須被重定向到

 http://selfservice.mycompany.com/customfolder/Directory1/UpdateUser.aspx?CASE_ID=00001

我的重寫規則是

RewriteEngine On

RewriteRule ^/Directory1/UpdateUser.aspx?(.*) http://selfservice.mycompany.com/customfolder/Directory1/UpdateUser.aspx?$1

但是此規則不起作用。 有指針嗎?

將此規則放在/Directory1/.htaccess

RewriteEngine On

RewriteRule ^UpdateUser\.aspx$ /customfolder/Directory1/UpdateUser.aspx [L,QSA,NC,R=302]

查詢字符串將自動結轉到目標URL。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM