Cheatsheet/htaccess
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
[[Cheatsheet]]
[[htaccess Cheatsheet (the jackol’s den):http://www.theja...
#contents
*cheatsheet for the .htaccess file [#w5f98d31]
**ディレクトリ参照を許可[#b260e6ff]
Options +Indexes
## block a few types of files from showing
IndexIgnore *.wmv *.mp4 *.avi
**ディレクトリ参照を不可[#qa4b7287]
Options All -Indexes
**エラーメッセージのカスタマイズ[#ya2814ed]
ErrorDocument 403 /forbidden.html
ErrorDocument 404 /notfound.html
ErrorDocument 500 /servererror.html
**HTML/SHTMLでのSSI動作[#yd28e3d3]
AddType text/html .html
AddType text/html .shtml
AddHandler server-parsed .html
AddHandler server-parsed .shtml
# AddHandler server-parsed .htm
**デフォルトページの変更 [#of5b0c3c]
定義順に従う
DirectoryIndex myhome.htm index.htm index.php
**他サイトからのアクセスをブロック[#e28b31e9]
<limit GET POST PUT>
order deny,allow
deny from 202.54.122.33
deny from 8.70.44.53
deny from .spammers.com
allow from all
</limit>
**LANユーザのみ許可[#f1a5b672]
order deny,allow
deny from all
allow from 192.168.0.0/24
**新ページ/ディレクトリへ訪問者をリダイレクト[#t76d68c7]
Redirect oldpage.html http://www.domainname.com/newpage....
Redirect /olddir http://www.domainname.com/newdir/
**特定のリファラによる他サイトからのアクセスをブロック[#p...
RewriteEngine on
RewriteCond %{HTTP_REFERER} site-to-block\.com [NC]
RewriteCond %{HTTP_REFERER} site-to-block-2\.com [NC]
RewriteRule .* - [F]
**Block Hot Linking/Bandwidth hogging [#i46900e5]
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain.co...
RewriteRule \.(gif|jpg)$ - [F]
**Want to show a “Stealing is Bad” message too? [#j66dfe07]
Add this below the Hot Link Blocking code:
RewriteRule \.(gif|jpg)$ http://www.mydomain.com/dontste...
**.htaccess(またはその他のファイル)を参照不可に[#u0e0ffd0]
<files file-name>
order allow,deny
deny from all
</files>
**500 Errorを回避 [#y15a3a2f]
# Avoid 500 error by passing charset
AddDefaultCharset utf-8
**ディレクトリにCGIアクセス権を付与[#n7f2d1c8]
Options +ExecCGI
AddHandler cgi-script cgi pl
# To enable all scripts in a directory use the following
# SetHandler cgi-script
**ディレクトリをパスワードで保護[#u250aa43]
Use the .htaccess Password Generator and follow the brie...
**スクリプトの拡張子を変更[#g9bbcdca]
AddType application/x-httpd-php .gne
gne will now be treated as PHP files! Similarly, x-httpd...
**MD5ダイジェストを使用[#td674151]
Performance may take a hit but if thats not a problem, t...
ContentDigest On
**ディレクティブのスペルチェック[#m3ccccaa]
From Jens Meiert: CheckSpelling corrects simple spelling...
The ContentDigest Directive
As the Apache core features documentation says: “This di...
Note that this can cause performance problems on your se...
To turn this on, just add ContentDigest On.
**帯域を保持[#gdc9e39a]
# Only if you use PHP
<ifmodule mod_php4.c>
php_value zlib.output_compression 16386
</ifmodule>
**magic_quotes_gpcはoff [#re9aa3ea]
# Only if you use PHP
<ifmodule mod_php4.c>
php_flag magic_quotes_gpc off
</ifmodule>
終了行:
[[Cheatsheet]]
[[htaccess Cheatsheet (the jackol’s den):http://www.theja...
#contents
*cheatsheet for the .htaccess file [#w5f98d31]
**ディレクトリ参照を許可[#b260e6ff]
Options +Indexes
## block a few types of files from showing
IndexIgnore *.wmv *.mp4 *.avi
**ディレクトリ参照を不可[#qa4b7287]
Options All -Indexes
**エラーメッセージのカスタマイズ[#ya2814ed]
ErrorDocument 403 /forbidden.html
ErrorDocument 404 /notfound.html
ErrorDocument 500 /servererror.html
**HTML/SHTMLでのSSI動作[#yd28e3d3]
AddType text/html .html
AddType text/html .shtml
AddHandler server-parsed .html
AddHandler server-parsed .shtml
# AddHandler server-parsed .htm
**デフォルトページの変更 [#of5b0c3c]
定義順に従う
DirectoryIndex myhome.htm index.htm index.php
**他サイトからのアクセスをブロック[#e28b31e9]
<limit GET POST PUT>
order deny,allow
deny from 202.54.122.33
deny from 8.70.44.53
deny from .spammers.com
allow from all
</limit>
**LANユーザのみ許可[#f1a5b672]
order deny,allow
deny from all
allow from 192.168.0.0/24
**新ページ/ディレクトリへ訪問者をリダイレクト[#t76d68c7]
Redirect oldpage.html http://www.domainname.com/newpage....
Redirect /olddir http://www.domainname.com/newdir/
**特定のリファラによる他サイトからのアクセスをブロック[#p...
RewriteEngine on
RewriteCond %{HTTP_REFERER} site-to-block\.com [NC]
RewriteCond %{HTTP_REFERER} site-to-block-2\.com [NC]
RewriteRule .* - [F]
**Block Hot Linking/Bandwidth hogging [#i46900e5]
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain.co...
RewriteRule \.(gif|jpg)$ - [F]
**Want to show a “Stealing is Bad” message too? [#j66dfe07]
Add this below the Hot Link Blocking code:
RewriteRule \.(gif|jpg)$ http://www.mydomain.com/dontste...
**.htaccess(またはその他のファイル)を参照不可に[#u0e0ffd0]
<files file-name>
order allow,deny
deny from all
</files>
**500 Errorを回避 [#y15a3a2f]
# Avoid 500 error by passing charset
AddDefaultCharset utf-8
**ディレクトリにCGIアクセス権を付与[#n7f2d1c8]
Options +ExecCGI
AddHandler cgi-script cgi pl
# To enable all scripts in a directory use the following
# SetHandler cgi-script
**ディレクトリをパスワードで保護[#u250aa43]
Use the .htaccess Password Generator and follow the brie...
**スクリプトの拡張子を変更[#g9bbcdca]
AddType application/x-httpd-php .gne
gne will now be treated as PHP files! Similarly, x-httpd...
**MD5ダイジェストを使用[#td674151]
Performance may take a hit but if thats not a problem, t...
ContentDigest On
**ディレクティブのスペルチェック[#m3ccccaa]
From Jens Meiert: CheckSpelling corrects simple spelling...
The ContentDigest Directive
As the Apache core features documentation says: “This di...
Note that this can cause performance problems on your se...
To turn this on, just add ContentDigest On.
**帯域を保持[#gdc9e39a]
# Only if you use PHP
<ifmodule mod_php4.c>
php_value zlib.output_compression 16386
</ifmodule>
**magic_quotes_gpcはoff [#re9aa3ea]
# Only if you use PHP
<ifmodule mod_php4.c>
php_flag magic_quotes_gpc off
</ifmodule>
ページ名: