There are some ways to redirect all sub-domains , but the very easiest way redirect by using .htaccess
Go to your file manager , open your .htaccess ; if you don’t have .htaccess file into your file manager then create the file and use the following codes :
RewriteEngine On
RewriteCond %{HTTP_HOST} ^[^.]+\.(domain\.com)$ [NC]
RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L,NE]
That’s it .