loading
Please wait while loading...

Read more Rewrite a subdomain to a sub directory

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]