Skip to content

Instantly share code, notes, and snippets.

@yuki777
Created July 19, 2012 01:41
Show Gist options
  • Save yuki777/3140208 to your computer and use it in GitHub Desktop.
Save yuki777/3140208 to your computer and use it in GitHub Desktop.
maintenance .htaccess
# maintenance文言のHTMLファイル用意しておく
ErrorDocument 503 /maintenance.html
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} !=/maintenance.html [NC]
RewriteCond %{REQUEST_URI} !\.css$
RewriteCond %{REQUEST_URI} !\.js$
RewriteCond %{REQUEST_URI} !\.jpg$
RewriteCond %{REQUEST_URI} !\.png$
RewriteCond %{REQUEST_URI} !\.gif$
# 全てのパスをメンテしたい場合
#RewriteRule ^.*$ - [R=503,L]
# mypage以下をメンテしたい場合
#RewriteRule ^mypage - [R=503,L]
# hoge/foo以下をメンテしたい場合
#RewriteRule ^hoge/foo - [R=503,L]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment