Kohana: What is the best way to serve robots.txt?

499 Views Asked by At

In our web app we're redirecting all 404's to a pretty error page, but for robots.txt we need to server a default page (or return 404), else google won't index us.

Should I be adding a route to bootstrap.php specifically for http://www.mydomain.com/robots.txt?

Or should I be doing this through .htaccess?

Was there a cleaner approach I overlooked?

1

There are 1 best solutions below

2
On BEST ANSWER

Just create the file. If .htaccess is configured correctly, the Kohana framework only comes to action if there is no 'direct hit' on the requested file.