Last active
August 29, 2015 14:05
-
-
Save gerasimua/3ac8da5fc9f8348d4763 to your computer and use it in GitHub Desktop.
Maintenance with exceptions by IP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SetEnv APPLICATION_ENV development | |
Options +FollowSymlinks | |
Options -Indexes | |
<IfModule mod_rewrite.c> | |
RewriteBase / | |
RewriteEngine On | |
RewriteCond %{REMOTE_ADDR} !=0.0.0.0 | |
RewriteCond %{REQUEST_URI} !^/maintenance\.html$ | |
RewriteRule ^(.*)$ maintenance.html [R=307,L] | |
# protect source code | |
RewriteRule ^(.*/)*\.svn/ / [F,L] | |
# loop stopping | |
RewriteCond %{ENV:REDIRECT_STATUS} 200 | |
RewriteRule .* - [L] | |
RewriteCond %{REQUEST_FILENAME} -s [OR] | |
RewriteCond %{REQUEST_FILENAME} -l [OR] | |
RewriteCond %{REQUEST_FILENAME} -d [OR] | |
RewriteCond %{REQUEST_URI} ^/(captcha|css|img|js|modules|uploads) [OR] | |
RewriteCond %{REQUEST_URI} \.(jpe?g|png|gif|ico|js|css)$ | |
RewriteRule ^.*$ - [NC,L] | |
RewriteRule ^.*$ index.php [NC,L] | |
</IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment