Hide subfolder for subdomain
.htaccess, mod-rewrite
Solution
I figured it out through a bunch of trial and error:
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^sub\.domain\.com$ [NC]
RewriteCond %{REQUEST_URI} !^/sub
RewriteRule ^(.*)$ sub/$1 [L]
Problem
so my subdomain currently goes to the same root folder as my domain. I would like to accomplish the following: ``` sub.domain.com => sub.domain.com/sub/ ``` with the /sub/ portion invisible to the user. I do not want to have the following happen: ``` sub.domain.com => domain.com/sub/ ``` Is there any way I can accomplish this without redirection and without getting stuck in an endless loop? I have this currently and I don't think it's working as it doesn't mask the /sub part: ``` RewriteEngine on RewriteCond %{HTTP_HOST} ^sub\.domain\.com$ [NC] RewriteCond %{REQUEST_URI} !^/sub RewriteRule .* http://sub.domain.com/sub[L] ``` I've looked endlessly online for something that accomplishes this but can't seem to find it...