Read more
Rewrite a subdomain to a sub directory
2012-07-30
Appache
URL Rewrite
Share a rewrite format that you can rewrite a sub domain to a sub directory ( not redirect ):
For example:
http://hello.cambyliverson.com
You will see the content of /hello
Which the url keep showing as http://hello.cambyliverson.com
Below is the code
RewriteCond %{HTTP_HOST} ^[www\\.]*sub-domain-name.domain-name.com [NC]
RewriteCond %{REQUEST_URI} !^/sub-domain-directory/.*
RewriteRule ^(.*) /sub-domain-directory/$1 [L]