David Parks
David Parks

Reputation: 32081

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

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?

Upvotes: 0

Views: 493

Answers (1)

GolezTrol
GolezTrol

Reputation: 116140

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.

Upvotes: 3

Related Questions