Apache的URL重寫規則的标志詳細說明
1) R[=code](force redirect) 強制外部重定向
2) F(force URL to be forbidden)禁用URL,傳回403HTTP狀态碼。
3) G(force URL to be gone) 強制URL為GONE,傳回410HTTP狀态碼。
4) P(force proxy) 強制使用代理轉發。
5) L(last rule) 表明目前規則是最後一條規則,停止分析以後規則的重寫。
6) N(next round) 重新從第一條規則開始運作重寫過程。
7) C(chained with next rule) 與下一條規則關聯
如果規則比對則正常處理,該标志無效,如果不比對,那麼下面所有關聯的規則都跳過。
8) T=MIME-type(force MIME type) 強制MIME類型
9) NS (used only if no internal sub-request) 隻用于不是内部子請求
10) NC(no case) 不區分大小寫
11) QSA(query string append) 追加請求字元串
12) NE(no URI escaping of output) 不在輸出轉義特殊字元
例如:RewriteRule /foo/(.*) /bar?arg=P1/%3d$1 [R,NE] 将能正确的将/foo/zoo轉換成/bar?arg=P1=zed
13) PT(pass through to next handler) 傳遞給下一個處理
例如:
RewriteRule ^/abc(.*) /def$1 [PT] # 将會交給/def規則處理
Alias /def /ghi
14) S=num(skip next rule(s)) 跳過num條規則
15) E=VAR:VAL(set environment variable) 設定環境變量