請幫忙 - 我需要一個帶有反斜杠引數的特定頁面的 rewriteRule,例如:
/page/parameter1/paramter2
重寫為
/anotherpage/paramter1/paramter2
試過這個,但我沒有作業:
RewriteRule ^page/$ /anotherpage.php/$ [L]
uj5u.com熱心網友回復:
將我的評論轉換為答案,以便將來的訪問者輕松找到該解決方案。
您可以使用此規則:
RewriteRule ^page/(.*)$ /anotherpage/$1 [L,NC]
請注意,我們將任何文本匹配page/到捕獲組中,并$1在目標中使用捕獲組的反向參考。
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/520810.html
上一篇:bash陣列轉換成字串模式
