Sim é possível com htaccess.
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} !^(www\.)?joaopedropereira\.com$ [NC]
RewriteCond %{HTTP_HOST} ^(.*\.)?([^\.]+)\.joaopedropereira\.com$ [NC]
RewriteCond %{DOCUMENT_ROOT}/subs/%2%{REQUEST_URI}/ -d
RewriteRule [^/]$
http://%2.joaopedropereira.com%{REQUEST_URI}/ [R=301,L]
RewriteCond %{HTTP_HOST} ^.*\.([^\.]+\.joaopedropereira\.com)$ [NC]
RewriteRule ^(.*)$
http://%1/$1 [R=301,L]
# abc.domain.com --> /subs/abc/
RewriteCond %{HTTP_HOST} !^(www\.)?joaopedropereira\.com$ [NC]
RewriteCond %{HTTP_HOST} ^([^\.]+)\.joaopedropereira\.com$ [NC]
RewriteCond %1:::%{REQUEST_URI} !^(.+):::/subs/\1(/.*)?$ [NC]
RewriteCond %{DOCUMENT_ROOT}/subs/%1/ -d
RewriteRule ^(.*)$ /subs/%1/$1 [QSA,L]