Add a file named robots.txt
at the root of the domain you wish to remove the indexation, and fill it with this:
User-agent: *
Disallow: /
You can also set this bunch of lines on your .htaccess
:
Header set X-Robots-Tag "noindex, nofollow"
EDIT: Also, to block only the subdomain, add a rewrite rule:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^DOMAINA.COM$
RewriteRule ^robotx\.txt$ robots-subdomain.txt