the_demon
Elite Member
- Nov 23, 2008
- 3,220
- 1,604
Hi guys,
I have a wordpress site that when Google tries fetching the robots.txt page it's throwing an error and Google is showing a 302 redirect to the home page. Oddly enough it works fine with the www version, but not with just http://example.com.
I tried adding an exclusion in the .htaccess file, but my modification caused the url to show a problem with the .htaccess. Thee error I get is: [an error occurred while processing this directive] the code I added to the .htaccess file is highlighted in red below. I even tried 301ing the robots.txt file to the www version of the site and that didn't work either.
If someone could help me find a working solution that would be much apppreciated.
I have a wordpress site that when Google tries fetching the robots.txt page it's throwing an error and Google is showing a 302 redirect to the home page. Oddly enough it works fine with the www version, but not with just http://example.com.
I tried adding an exclusion in the .htaccess file, but my modification caused the url to show a problem with the .htaccess. Thee error I get is: [an error occurred while processing this directive] the code I added to the .htaccess file is highlighted in red below. I even tried 301ing the robots.txt file to the www version of the site and that didn't work either.
If someone could help me find a working solution that would be much apppreciated.
Code:
RewriteEngine On
[COLOR="#FF0000"]RewriteRule ^robots.txt$ - [L][/COLOR]
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]