This is a fairly new installation. Almost no plugins. Everyting works fine except the dinamically-generated robots.txt gives Error 500. Google doesn't like it much. (won't read my sitemap).
All other pages work fine.
Permalinks are "default".
htaccess on public_html is:
# BEGIN WordPress
# END WordPress
Server logs are useless:
66.249.73.225 - - [11/Dec/2012:15:06:11 -0500] "GET /robots.txt HTTP/1.1" 500 671 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
I'm definitely no WP expert. Found function do_robots() in functions.php but don't know who calls it.
I'd appreciate any pointers on how to troubleshoot this further. Otherwise... maybe generating a static robots.txt file? Not sure how would that interact wit the one WP tries to build.
EDIT:
As requested, this is the function in my functions.php file:
/**
* Display the robots.txt file content.
*
* The echo content should be with usage of the permalinks or for creating the
* robots.txt file.
*
* @since 2.1.0
* @uses do_action() Calls 'do_robotstxt' hook for displaying robots.txt rules.
*/
function do_robots() {
header( 'Content-Type: text/plain; charset=utf-8' );
do_action( 'do_robotstxt' );
$output = "User-agent: *\n";
$public = get_option( 'blog_public' );
if ( '0' == $public ) {
$output .= "Disallow: /\n";
} else {
$site_url = parse_url( site_url() );
$path = ( !empty( $site_url['path'] ) ) ? $site_url['path'] : '';
$output .= "Disallow: $path/wp-admin/\n";
$output .= "Disallow: $path/wp-includes/\n";
}
echo apply_filters('robots_txt', $output, $public);
}
WPshould work, remove/disable the function and see what happens. – Sheikh Heera Dec 11 '12 at 20:29