开发者

Web master tools showing 404 for /a in Kohana based sites?

开发者 https://www.devze.com 2023-02-10 04:07 出处:网络
I have noticed when working with various Kohana sites that webmaster tools almost always flags up /a as 404\'ing. I have no 开发者_如何转开发specific code to show you because it occurs in pretty much

I have noticed when working with various Kohana sites that webmaster tools almost always flags up /a as 404'ing. I have no 开发者_如何转开发specific code to show you because it occurs in pretty much all of them.

I just wondered if anyone else had or has fixed this problem. Is it a known issue?

Thanks.


Please provide some more information.

Is /a a valid location in your website? Of course it's going to flag /a if it doesn't exist.


jQuery is the root source of the code being picked up by the Googlebot. Within the jQuery file itself is this line...

<a href='/a' style='color:red;float:left;opacity:.55;'>a</a>

As per Google (see below), add a 301 redirect to the htaccess file to kill this problem for good.

Redirect 301  /a  http://www.mySite.com

The following is a response from Google employee JohnMu on this issue in the thread I started at Google Groups.

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

See this SO answer for even more information:

https://stackoverflow.com/a/6587142/594235

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号