Skip to content

Instantly share code, notes, and snippets.

@Orangetronic
Last active December 22, 2015 23:49
Show Gist options
  • Save Orangetronic/6549372 to your computer and use it in GitHub Desktop.
Save Orangetronic/6549372 to your computer and use it in GitHub Desktop.
Helpful mod_rewrite snippets: 1. Apache mod_rewrite rule to fake virtualhost in shared hosting environments where apache config files are not accessible.
RewriteCond %{HTTP_HOST} ^mydomainname\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.mydomainname\.com$
RewriteCond %{REQUEST_URI} !^/subfoldername/
RewriteRule (.*) /subfoldername/$1
#from http://stackoverflow.com/a/11090555/2776197
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment