特定のIPアドレスのからのアクセスを制限
order allow,deny
allow from all
deny from xxx.xxx.xx.xx
order allow,deny … 許可・一部拒否
allow from all … とりあえず全てを許可
deny from tagindex.com … tagindex.comを拒否
deny from .net … .netを拒否
deny from 61.115. … 61.115.で始まるアドレスを拒否
特定のホストからのアクセスを拒否する指定です。
拒否したいホスト名、またはIPアドレスを、deny from に続けて記述します。
特定のリファラーからのアクセス制限
SetEnvIf Referer "^http://www\.xxxxxx\.net" ref_no
order allow,deny
allow from all
deny from env=ref_no
参考先:.htaccess実践活用術
特定のファイルからのアクセス制限
<Files ~ "\.(dat|log|csv||tsv)$">
deny from all
</Files>
参考先:futomi's CGI Cafe - .htaccess - 特定のファイルだけ守る
インデックスファイルのファイル以外へのアクセスを制限する
DirectoryIndex index.html
Options -Indexes
リダイレクトの設定(ディレクトリ構造の変更)
Redirect permanent /test/ http://www.shtml.jp/htaccess/
エラードキュメントに任意のファイルを指定
ErrorDocument 401 /error/401-file-not-fonund.html
ErrorDocument 403 /error/403-forbidden.html
ErrorDocument 404 /error/404-authorization.html
ErrorDocument 500 /error/500-internal-server-error.html
RSSファイルでダウンロードダイアログを表示させない
AddType text/xml .xml .rdf .xsl
AddHandler server-parsed .xml .rdf .xsl
参考先:第41回(2005年5月号) 仕掛けで見せる! WEBデザインTIPS & TRICKS [ web creators]


