htaccess †htaccessのサンプルページ 究極の.htaccess パスを通す †PHPのget_include_path関数、もしくわ、ini_get('include_path')関数で 現在設定してあるinclude_pathの設定を取得できる php_value include_path ".:/usr/local/lib/php:/usr/local/lib/php/Smarty-2.6.2/libs" mod_rewrite †RewriteEngine on RewriteRule !\.(js|ico|gif|jpg|png|css)$ index.php indexの設定 †DirectoryIndex index.html index.php ベーシック認証 †AuthUserFile /home/minaco/.htpasswd AuthGroupFile /dev/null AuthName "Please enter your ID and password" AuthType Basic require valid-user <Files ~ "^.(htpasswd|htaccess)$"> deny from all </Files> メンテ画面を表示 †1 Order Deny,Allow 2 Allow from 000.000.000.000 //アクセスを許可するIP 3 Deny from all 4 5 ErrorDocument 403 http://sample.minaco.net/mente.html 6 ErrorDocument 404 http://sample.minaco.net/mente.html 7 ErrorDocument 500 http://sample.minaco.net/mente.html 8 9 <Files ~ "^mente.html$"> 10 Allow from all 11 </Files> 解説 †1~3行で、http://sample.minaco.net/のアクセスを全て拒否する。 ただし、2行目で特定のIPからアクセスした場合のみアクセスを許可する。 5~7行目で、エラー画面に飛んできたときに、どの画面を表示するかを設定する。 なお、この場合、mente.htmlを表示するように設定している。 9~11行目のところで、mente.htmlファイルだけはアクセスを許可するように設定。 ちなみに、リダイレクトの設定は下記のようにも行えるが、 「Redirect permanent http://sample.minaco.net/ http://sample.minaco.net/ 」かな!? 同じサーバ内だと無限ループするため、上記のやりかたで行う。 Stringの設定 †php_value mbstring.language Japanese php_value mbstring.internal_encoding EUC-JP php_value mbstring.http_input auto php_value mbstring.http_output EUC-JP php_flag mbstring.encoding_translation On php_value mbstring.detect_order auto php_value mbstring.substitute_charctoer none php_value mbstring.script_encoding UTF-8 Comment †
Counter: 6148,
today: 1,
yesterday: 0
|