Maintenance mode with .htaccess

/ Published in: Apache
Save to your folder(s)

Copy this code and paste it in your HTML
  1. Options +FollowSymlinks
  2. RewriteEngine on
  3. # exclude maintenance page
  4. RewriteCond %{REQUEST_URI} !/maintenance.php$
  5. # enter ip to allow access
  6. RewriteCond %{REMOTE_HOST} !^11\.11\.11\.11
  7. # exclude files from rewrite
  8. RewriteCond %{REQUEST_URI} !/css/(.*)$
  9. RewriteCond %{REQUEST_URI} !/images/(.*)$
  10. #maintenance page
  11. RewriteRule $ /maintenance.php [R=302,L]

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.