.htaccessに関する覚え書き
- November 5th, 2008
- Posted in 個人的ないろいろ
- Write comment
すぐ忘れてしまうのでメモ程度にエントリー。
- ディレクトリー内をブラウズ可能に
Options +Indexes ## block a few types of files from showing IndexIgnore *.wmv *.mp4 *.avi
Options All -Indexes
ErrorDocument 403 /somePage1.html ErrorDocument 404 /somePage2.html ErrorDocument 500 /somePage3.html
DirectoryIndex myhome.htm index.htm index.php
order deny,allow deny from 123.456.789.00 deny from 123.456.789.00 deny from .someDomain.com allow from all
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} ^searchbot1 [OR]
RewriteCond %{HTTP_USER_AGENT} ^searchbot2 [OR]
RewriteCond %{HTTP_USER_AGENT} ^searchbot3
RewriteRule ^(.*)$ http://www.yourSite.com/goAway.html
もしくは次。
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} ^searchbot1 [OR]
RewriteCond %{HTTP_USER_AGENT} ^searchbot2 [OR]
RewriteCond %{HTTP_USER_AGENT} ^searchbot3
RewriteRule ^(.*)$ http://www.someOtherWebsite.com/ [R, L]
元記事は以下からどうぞ。
» htaccess Cheatsheet | marketing . web . design
■ 関連記事
- 効果的な404ページを自動生成してくれるGoogleの『Custom 404 pages』 | IDEA*IDEA
- 文字コードを変えて一気に出力する方法(PHPのob_start) | IDEA*IDEA
- 携帯端末以外のIPを制限する.htaccessを簡単生成!『Mobile IP htaccess Maker』 | IDEA*IDEA


No comments yet.