PGメモ

非エンジニアの記録

mod_rewrite

特定のファイルにアクセスきたら404

<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_URI} ^/hoge.html RewriteCond %{REMOTE_ADDR} !^127.0.0.1$ RewriteRule .* /404.php [L] </IfModule>127.0.0.1以外からアクセスあったら404

特定のIP以外503

</IfModule> RewriteEngine On RewriteCond %{REQUEST_URI} ^/hogehoge.html RewriteCond %{REMOTE_ADDR} !^192\.168\.0\.1$ RewriteCond %{REMOTE_ADDR} !^192\.168\.0\.100$ RewriteRule .* /503.php [R=503,L] </IfModule>