Created
September 17, 2018 01:40
-
-
Save vmrfriz/377274dc815a159ed8c0d788481d81e8 to your computer and use it in GitHub Desktop.
.htaccess for multidomain site
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
RewriteCond %{HTTP_HOST} ^(www\.)?(.*)$ [NC] | |
RewriteCond %{REQUEST_URI} !^/%2/ | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^(.*)$ /%2/$1 | |
RewriteCond %{HTTP_HOST} ^(www\.)?(.*)$ [NC] | |
RewriteRule ^(/)?$ %2/index.php | |
</IfModule> | |
# Prevent viewing of .htaccess file | |
<Files .htaccess> | |
order allow,deny | |
deny from all | |
</Files> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment