「Security」.htaccess設定:Apache
Apacheにてディレクトリ単位で設置・設定できる設定ファイル、ID・パスワードによる制限、IPアドレス・リモートホストによる制限、エラーカスタマイズ、MIME指定など
Core
Comment
#
Character code, BOM(バイトオーダーマーク: byte order mark), End of sentence
UTF-8 without BOM, Sentence New Line
FTP
ASCII
Permission
644, Shared server: 604(他のユーザーによる閲覧対策: Measures against browsing by other users)
ErrorDocument
ErrorDocument <3-digit-code> <action>
Apache Error Message
ErrorDocument 503 default
Mesasge
ErrorDocument 404 "Sorry, Not Found"
RedirectMesasge
ErrorDocument 404 http://example.com/ or /error/404error.html
<Files>ディレクティブ
<Files filename>
...
</Files>
ファイル名・?(一文字)・*(任意の文字列)
<Files password.html>
...
</Files>
~をつけると正規表現
<Files ~ "\.(gif|jpe?g|png)$">
Module
mod_rewrite
RewriteRule
RewriteRule pattern target [Flag1,Flag2,Flag3]
RewriteRule Flags
B (escape backreferences)
BNP | backrefnoplus (don't escape space to +)
C | chain
CO | cookie
DPI | discardpath
E | env
END
現在のリライト処理だけでなくhtaccess自体のリライト処理も終了します。
F | forbidden
G | gone
H | handler
L | last
「mod_rewrite」のルールセットプロセスを停止します。
N | next
NC | nocase
NE | noescape
P | proxy
PT | passthrough
QSA | qsappend
QSD | qsdiscard
QSL | qslast
R | redirect
targetにリダイレクト。デフォルトでHTTPステータスコード「302」、[R=3xx]とすることで「300~399」の範囲でHTTPステータスコードを発行し、それ以外は破棄され[L]の使用と同じになる。(とあるが、範囲以外のコードでも帰ってくるが。。。) シンボリック名「temp(default), permanent, seeother」も使用可能。
S | skip
T | type
最終更新日