RewriteCond %{HTTP_HOST} !^www\.Domain\.com
RewriteCond %{HTTP_HOST} ^([^.]+)\.Domain\.com$
RewriteRule ^$ http://Domain.com/FolderName/$1 [L]
When I type in SubDomain.DomainsName.com it is redirected to DomainName.com/FolderName, but I want it to be DomainName.com/FolderName/SubDomain
The SubDomain is not passed to $1, any ideas to why.
There is only one mistake
$1has to be%1.From :RewriteCond Apache Docs