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.

Revisions

  1. @invalid-email-address Anonymous created this gist Dec 9, 2011.
    20 changes: 20 additions & 0 deletions Serve site based on IP Address conditional
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    # 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]