Skip to content

Instantly share code, notes, and snippets.

@Critter
Created June 6, 2013 17:23
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 Critter/5723246 to your computer and use it in GitHub Desktop.
Save Critter/5723246 to your computer and use it in GitHub Desktop.
Redirect all except my IP to subdirectory using .htaccess
# my ip
RewriteCond %{REMOTE_HOST} !^255\.255\.255\.255
# this prevents looping
RewriteCond %{REQUEST_URI} !^/maintenance/?
RewriteCond %{REQUEST_URI} /(.*)$
# the redirect
RewriteRule (.*) /maintenance [R=301,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment