404 errors on /a folders in Webmaster Tools
In Google Webmaster Tools, under crawling errors, my number one 404 error is something called
www.d开发者_JS百科omain.com/a
There is no such thing in my site and there is no link to it. What is wrong, what does it mean? In the site log, there is no error about 404 error pointing to /a. W3C checker says no error. What can I do?
It's not you, it has to be the Googlebot. (none of this has to do with php; perhaps somebody can remove the php tag.)
I have eight sites in my Google Webmaster Tools and two totally unrelated sites are showing this same thing. Neither site showing this issue uses PHP.
The only thing I can think of is that Google's bot is incorrectly parsing the HTML and somehow appending closing "a" tags onto the root URL. Sounds stupid but it's the only thing that can explain multiple unrelated instances of this problem.
Has anyone started a thread on this in the Google Forum yet?
I'm not sure what effect this will have on the root problem but I put this in my htaccess file to hopefully clear out the false 404 errors. (Edit: this is the recommended solution by Google.)
Redirect 301 /a http://www.mysite.com
EDIT:
Reported to Google Help Forum:
http://www.google.com/support/forum
EDIT 2:
Both sites validate at the W3C and neither use PHP.
EDIT 3:
The "/a" is coming from inside jQuery v1.5.2. This is the root cause.
Within jQuery itself is this line...
<a href='/a' style='color:red;float:left;opacity:.55;'>a</a>
EDIT 4:
Block it with the robots.txt file. (According to Google, this will only change the Webmaster Tools Crawl Error from a "404" to a "Blocked by robots.txt")
Disallow: /a/
Disallow: /a
EDIT 5:
The following is a response from Google employee JohnMu on this issue in the thread I started at Google Groups. Looks like I'm going to stick with the 301 after all.
JohnMu
Google Employee
4:39 AM
Hi guys
Just a short note on this -- yes, we are picking up the "/a" link for many sites from jQuery JavaScript. However, that generally isn't a problem, if we see "/a" as being a 404, then that's fine for us. As with other 404-URLs, we'll list it as a crawl error in Webmaster Tools, but again, that's not going to be a problem for crawling, indexing, or ranking. If you want to make sure that it doesn't trigger a crawl error in Webmaster Tools, then I would recommend just 301 redirecting that URL to your homepage (disallowing the URL will also bring it up as a crawl error - it will be listed as a URL disallowed by robots.txt).
I would also recommend not explicitly disallowing crawling of the jQuery file. While we generally wouldn't index it on its own, we may need to access it to generate good Instant Previews for your site.
So to sum it up: If you're seeing "/a" in the crawl errors in Webmaster Tools, you can just leave it like that, it won't cause any problems. If you want to have it removed there, you can do a 301 redirect to your homepage.
Cheers
John
Check your Apache error logs. Or install a small PHP file which saves the $_SERVER["HTTP_REFERER"]
like:
<?php
$f = fopen("logfile.txt", "a");
fwrite ($_SERVER["HTTP_REFERER"] . "\n");
fclose ($f);
Then create a .htaccess file to redirect calls to /a to this PHP:
Options FollowSymLinks
RewriteEngine On
RewriteRule ^a$ somthing.php
Alternatively you can save your PHP on the name /a/index.php
, that way you do not need redirect.
Do 301 redirection or otherwise do URL removal request form your web master tools account.
GWT--> Site configuration--> crawl access--> URL removal request
精彩评论