I have this folder structure
webroot/
www/
srv/
When I visit http://www.domain.com, it points to the www/ folder using this codes:
RewriteCond %{HTTP:Host} ^(?:www\.)?domain\.com$
RewriteRule (.*) /www/$1 [NC,L,NS]
It shows the contents of the www/ folder without the folder name on the address bar. It retains its name to:
http://www.domain.com
What I want is to use the .htaccess mod_rewrite to change from:
http://sub.domain.com
to
http://sub.domain.com/srv
Where it shows the sub folder and it contents. Is it possible? I tried:
RewriteCond %{HTTP:Host} ^(?:sub\.domain\.com)?$
RewriteRule ^(.*)$ http://%{HTTP_HOST}/srv/$1 [R=301,L]
but it returns a redirect loop error. How can I do this?