Skip to content

Instantly share code, notes, and snippets.

@sids
Created July 11, 2009 09:53
Show Gist options
  • Save sids/145210 to your computer and use it in GitHub Desktop.
Save sids/145210 to your computer and use it in GitHub Desktop.
Apache mod_rewrite tricks
### Forcing a particular domain ###
RewriteCond %{HTTP_HOST} !^www.sids.in$ [NC]
RewriteRule ^(.*)$ http://www.sids.in$1 [R=301,L]
### Forbid access to certain paths ###
RewriteRule ^/.passwords$ - [F]
### Appending to the query string ###
RewriteRule (^.*$) $1?name=value [QSA]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment