Skip to content

Instantly share code, notes, and snippets.

@AntMooreWebDev
Created January 26, 2021 11:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AntMooreWebDev/0eb79b3745709bd75458eb5fe6e190c7 to your computer and use it in GitHub Desktop.
Save AntMooreWebDev/0eb79b3745709bd75458eb5fe6e190c7 to your computer and use it in GitHub Desktop.
A small rewrite rule to send all users to maintenance page (except some excluded IP)
RewriteEngine on
RewriteCond %{REMOTE_ADDR} !^11\.22\.33\.44$ [NC] # Can add multiple lines here for different IPs
RewriteCond %{REQUEST_URI} !^/maintenance.html$ [NC]
RewriteRule ^(.*)$ "/maintenance.html" [R=302,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment