How to create robots.txt file for all domains on Apache server
Apache mod_alias is designed for this and available from the core Apache system, and can be set in one place with almost no processing overhead, unlike mod_rewrite.
Alias /robots.txt C:/xampp/vhosts/override-robots.txt
With that line in the apache2.conf file, outside all the vhost's, http://example.com/robots.txt - on any website it serves, will output the given file.