Skip to content

Instantly share code, notes, and snippets.

@davidyell
Last active December 11, 2015 03:28
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 davidyell/4538142 to your computer and use it in GitHub Desktop.
Save davidyell/4538142 to your computer and use it in GitHub Desktop.
.htaccess mod_rewrite utility rules
# Pass all the /forums stuff through the routing
RewriteCond %{REQUEST_URI} "/forums/"
RewriteRule (.*) $1 [L]
# If you need to lock down access to a folder, such as a CMS, then use the following
RewriteRule ^BusinessThing(.*)$ /maintenance.html [R=301,L]
# Redirecting everyone to maintenance
# Reference, http://www.techiecorner.com/97/redirect-to-maintenance-page-during-upgrade-using-htaccess/
RewriteCond %{REQUEST_URI} !/maintenance.html$
RewriteRule $ /maintenance.html [R=302,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment