I am trying to serve a robots.txt using the Perl Dancer web framework. I thought having a route that just returned the text would work, but it seems to be wrapping it in html
and body
tags. I'm assuming this won't be interpreted properly as a robots.txt file by crawlers.
Any idea how to do this properly?
Here is how I have the route written:
get '/robots.txt' => sub {
return "User-agent: *\nDisallow: /";
};
Thanks in advance!