@lukasbestle I think ive figured it out. The staging server (which is a subdomain) forces www and so does the live server. If i disable the the www forcing, the robots files comes out properly.
So the question issss… how can I leave the .htaccess rule in to force the www AND get a weirdness free robots file.
to be clear…
This gets the < on the first line:
Which i dont think is strictly legal, but the site does work. As i understand it, www is a subdomain on its own, so i think technically the above is a subdomain of a subdomain.