Skip to content

Instantly share code, notes, and snippets.

@lyquix-owner
Created June 3, 2016 21:02
Show Gist options
  • Save lyquix-owner/ef3702f05c6e0b231d3c970bd1a6d16c to your computer and use it in GitHub Desktop.
Save lyquix-owner/ef3702f05c6e0b231d3c970bd1a6d16c to your computer and use it in GitHub Desktop.
Maintenance redirect: temporarily redirect all pages to a maintenance page, except for images, css, js, and except specific IP address
# Maintenance Redirect
RewriteEngine On
RewriteCond %{REMOTE_ADDR} !^123\.45\.67\.89$
RewriteCond %{REQUEST_URI} !.*\.(css|jpg|jpeg|gif|png|svg|js) [NC]
RewriteCond %{REQUEST_URI} !/maintenance.html$
RewriteRule .* /maintenance.html [R=503,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment