也可請參考下面網址
http://res.phpchina.com/manual/apache/mod/mod_rewrite.html
http://hi.baidu.com/phpzhang/blog/item/50ca004bd343b4f982025c87.html
1) R[=code](force redirect) 強制外部重定向
強制在替代字符串加上http://thishost[:thisport]/前綴重定向到外部的URL.如果code不指定,將用缺省的302 HTTP狀態碼。
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) 設置環境變量
Apache HTTP Server 版本2.2 中文手冊
http://res.phpchina.com/manual/apache/mod/mod_rewrite.html#rewriterule
-------------------------------------------------------------------------------------------
如何實現如下
http://xxx/x.jpg 或 http://xxx/x.bmp 多種文件擴展名
可以通過負載均衡的方式 自動定向到如下多個地址:
1、http://yyy/x.jpg 或 http://yyy/x.bmp
2、http://zzz/x.jpg 或 http://zzz/x.bmp
以達到負載均衡的目的,構建分佈式圖片文件服務器
[url=http://www.idouye.com/]http://www.idouye.com 愛豆葉資料分享[/url]
Apache RewriteRule的標誌一覽
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章
Apache HTTP Server詳解
顺其自然~
2020-03-08 12:51:19
Xdebug 配置 php 調試器
changyang208
2020-02-24 08:31:01
apache http的語句,允許被訪問
攀峰者
2020-02-22 13:11:50
新_CentOS 6下搭建Apache+MySQL+PHP+SSL
sealbird
2018-11-20 02:47:16
CentOS 6 架設 apache + php + mysql
sealbird
2018-11-20 02:47:16
CentOS 下管理自定義 PHP 計劃任務代碼的守護進程腳本
sealbird
2018-11-20 02:47:15
CentOS 5.5+Apache+PHP+MySQL 5部署筆記(更新)
sealbird
2018-11-20 02:47:15
apache 防盜鏈,限帶寬和連接數
sealbird
2018-11-08 03:25:01
apache防盜鏈(mod_perl試用二)
sealbird
2018-11-08 03:25:01
Apache 防盜鏈(Apache Anti-Leech)技術的簡單實現
sealbird
2018-11-08 03:25:01
apachemod_proxy 集羣
sealbird
2018-11-04 02:51:46
apache2.2 tomcat6.0 負載均衡集羣整理配置
sealbird
2018-11-04 02:51:46
Apache Http(反向代理)Tomcat模式下訪問報錯:Proxy Error
爪洼实习生
2018-08-29 08:36:27
給Tomcat,Apache配置gzip壓縮(HTTP壓縮)功能
wangxuefeng_yctc
2018-08-25 02:33:36