Skip to content

Instantly share code, notes, and snippets.

@iitenkida7
Created July 26, 2017 16:10
Show Gist options
  • Save iitenkida7/58f7b28aab1d4b59a81671017e869c9a to your computer and use it in GitHub Desktop.
Save iitenkida7/58f7b28aab1d4b59a81671017e869c9a to your computer and use it in GitHub Desktop.
Apache_Maintenance_mode
#メンテナンス切り替えサンプル
ErrorDocument 503 /mainte/index.html
RewriteEngine on
RewriteCond /home/hoge/contents/mainte_mode -f
RewriteCond %{X-Forwarded-For} !^127\.0\.0\.1$
RewriteCond %{REMOTE_ADDR} !^127\.0\.0\.1$
RewriteCond %{REQUEST_URI} !^/mainte/.*
RewriteCond %{REQUEST_URI} !^/srv-status
RewriteRule ^.*$ - [R=503,L]
Alias /mainte /home/hoge/contents/mainte
<Directory "/home/hoge/contents/mainte">
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment