Skip to content

Instantly share code, notes, and snippets.

@gaboesquivel
Created January 10, 2013 18:36
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 gaboesquivel/4504605 to your computer and use it in GitHub Desktop.
Save gaboesquivel/4504605 to your computer and use it in GitHub Desktop.
Redirect Main Domain to subfolder
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?main\-domain.com$ [NC]
RewriteCond %{REQUEST_URI} !^/sub\-folder/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /sub-folder/$1
RewriteCond %{HTTP_HOST} ^(www.)?main\-domain.com$ [NC]
RewriteRule ^(/)?$ sub-folder/index.php [L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment