htaccess redirect all subdomains + www to domain with cname, vhosts and htaccess
snippet in htaccess

htaccess redirect all subdomains + www to domain with cname, vhosts and htaccess

user3211

RewriteEngine On

RewriteCond %{HTTP_HOST} ^[^.]+\.(domain\.com)$ [NC]
RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L,NE]