the following htaccess redirected subdomains to subfolders with same names
subdomain mooga redirected to folder mooga and we have subfolder blog in mooga
RewriteCond %{HTTP_HOST} ^((?!www\.)[^.]+)\.example\.com$
RewriteCond %1::%{REQUEST_URI} !^(.*?)::/\1/?
RewriteRule ^(.*)$ /%1/$1 [L,QSA]
https://mooga.example.com/blog/ work good
https://mooga.example.com/blog will redirected to https://mooga.example.com/mooga/blog/
I want /blog/ and /blog works as same and not redirected to /mooga/blog/
DirectorySlashis interfering. If you want to turn it off, pay attention to the security warning though.