Skip to content

Instantly share code, notes, and snippets.

@Critter
Created June 6, 2013 17:23
Show Gist options
  • 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