.htaccess rewrite subdomain to directory
snippet in htaccess

.htaccess rewrite subdomain to directory

user2446

RewriteEngine on

RewriteCond %{HTTP_HOST} ^subdomain\.example\.com$
RewriteCond %{REQUEST_URI} !^/subdomains/subdomain
RewriteRule ^(.*)$ /subdomains/subdomain/$1 [L]