Skip to content

Instantly share code, notes, and snippets.

@johnbacon
Created December 9, 2011 21:35
Show Gist options
  • Save johnbacon/1453405 to your computer and use it in GitHub Desktop.
Save johnbacon/1453405 to your computer and use it in GitHub Desktop.
Serve one site for the specified IP addresses, serve a temporary page otherwise
# Show temporary page for everyone but certain IP addresses.
# My home IP:
RewriteCond %{REMOTE_HOST} !^12\.220\.82\.229
# My work IP:
RewriteCond %{REMOTE_HOST} !^12\.220\.82\.229
# Server IP (needed in some cases):
RewriteCond %{REMOTE_HOST} !^64\.207\.128\.246
RewriteCond %{REMOTE_HOST} !^64\.207\.128\.146
RewriteCond %{REMOTE_HOST} !^70\.32\.65\.137
# Don't redirect requests for files that are needed for the temporary page:
RewriteCond %{REQUEST_URI} !/images*$
RewriteCond %{REQUEST_URI} !/comingsoon/logo\.gif$
RewriteCond %{REQUEST_URI} !/comingsoon/favicon\.ico$
# Redirect all other requests to the temporary page:
RewriteRule .* /fifteenth-anniversary [R=302,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment