We have a development server at dev.example.com that is being indexed by Google. We are using AWS Lightsail to duplicate the development server to our production environment in totality — the same robots.txt file is used on both dev.example.com and example.com.
Google's robots.txt documentation doesn't explicitly state whether root domains can be defined. Can I implement domain specific rules to the robots.txt file? For example, is this acceptable:
User-agent: *
Disallow: https://dev.example.com/
User-agent: *
Allow: https://example.com/
Sitemap: https://example.com/sitemap.xml
To add, this can be resolved through .htaccess rewrite engine — my question is specifically about robots.txt.