I have a website which uses CloudFlare CDN. At the CDN setup, CloudFlare created a sub-domain like direct.example.com to my website, which can be used to override CloudFlare and access the site directly.
When I do a google search for "site:direct.example.com" it comes up with results. It means google had also crawled and indexed that sub-domain too. The problem is, since example.com & direct.example.com both consists of same content, it will end up in a content duplication. (I think it's not good for SEO).
So what I want is google bot to not to crawl and index "direct.example.com". I tried to use robots.txt to do the trick, but I failed since both uses the same robots.txt. What should I do to entirely prevent my sub-domain from Indexing? Is there any other options to over come this problem?