我有一個RewriteRule標誌的問題。我有一個「主」RewriteRule處理我的應用程序,但我也有一些需要以不同方式處理的URL(請參閱自定義路由)。RewriteRule規則順序和標誌
我試過很多不同的標誌,但它從來沒有給我想要的結果。檢查我想要的代碼中的第一條評論。
# First check if this pattern is found, and if it's not, continue to the next one and disregard this one
RewriteRule ^test/report/([0-9]+)/?$ index.php?page=report&id=$1 [PT,L]
RewriteRule ^(.*)/?$ index.php?page=$1 [PT,L]
在此先感謝!
確實,我忘了刪除C標誌。刪除它或用L標誌替換它將導致頁面參數始終爲'index.php'。非常奇怪 – Jesse 2011-03-31 19:13:09
@Jesse看我的編輯。 – Andrew 2011-03-31 19:22:04
謝謝,這似乎工作,但應該有更好的解決方案,你不覺得嗎? – Jesse 2011-03-31 20:56:57