Skip to content

Instantly share code, notes, and snippets.

@WordPress-Handbuch
Created February 19, 2019 07:01
Show Gist options
  • Save WordPress-Handbuch/77706dbe115853e446dc011ddf7908cb to your computer and use it in GitHub Desktop.
Save WordPress-Handbuch/77706dbe115853e446dc011ddf7908cb to your computer and use it in GitHub Desktop.
.htaccess fragment for loading a static HTML page except when images are being requested or the user comes from 1.2.3.4 (insert your IP here)
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REMOTE_ADDR} !^1\.2\.3\.4
RewriteCond %{REQUEST_URI} !/wartung.html$ [NC]
RewriteCond %{REQUEST_URI} !\.(jpe?g?|png|gif) [NC]
RewriteRule .* /wartung.html [R=302,L]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment