.htaccess
附錄:.htaccess (リンク集)
文字コード:UTF-8 (BOM無し )
改行コード:LF
擴張子無しでアクセス出來るようにする
Options +MultiViews
擴張子無しに轉送する
RewriteCond %{THE_REQUEST} \.(html|htm)\ HTTP
RewriteRule ^(.*)\.(html|htm)$ /$1 [R=301,L]
index
を/
に轉送する
RewriteCond %{THE_REQUEST} ^(.*)/index\.[^/\.]+
RewriteRule ^(.*)/index\.[^/\.]+$ /$1 [R=301,L]
RewriteRule ^index\.[^/\.]+$ / [R=301,L]
RewriteRule ^index$ / [R=301,L]
MIMEの設定
AddType "application/xhtml+xml; charset=utf-8" xhtml xht
AddType "text/html; charset=utf-8" html htm
AddType "text/css; charset=utf-8" css
AddType "text/plain; charset=utf-8" txt
AddType application/pdf pdf
AddType image/png png
AddType image/jpeg jpeg jpg
AddType image/vnd.adobe.photoshop psd
アクセス拒否
ユーザーエージェントでの指定
SetEnvIf User-Agent "Googlebot" denybot
SetEnvIfNoCase User-Agent "bingbot" denybot
Order Allow,Deny
Allow from all
Deny from env=denybot
IPアドレスでの指定
Deny from 66.249.64.0/19
編:絲 公開:2020年2月3日 更新:2021年3月14日 適用:CC0 [著作權抛棄](第三者の著作物を除く )