网站站长工具中的 /a 文件夹出现 404 错误

发布于 2024-10-26 19:25:38 字数 184 浏览 5 评论 0原文

在 Google 网站管理员工具中,在抓取错误下,我的第一个 404 错误是“

www.domain.com/a 

我的网站中没有这样的东西,也没有指向它的链接”。出了什么问题,这是什么意思?在站点日志中,没有关于指向/a的404错误的错误。 W3C 检查器显示没有错误。我能做些什么?

In Google Webmaster Tools, under crawling errors, my number one 404 error is something called

www.domain.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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

天煞孤星 2024-11-02 19:25:38

不是你,一定是 Googlebot。 (这些都与 php 无关;也许有人可以删除 php 标签。

我的 Google 网站管理员工具中有 8 个网站,而两个完全不相关的网站也显示了同样的内容。显示此问题的两个网站均不使用 PHP。

我唯一能想到的是 Google 机器人错误地解析了 HTML,并以某种方式将结束“a”标签附加到根 URL 上。听起来很愚蠢,但这是唯一可以解释此问题的多个不相关实例的方法。

有人在 Google 论坛中就此问题发起过讨论吗?

我不确定这会产生什么影响已经解决了根本问题,但我将其放入我的 htaccess 文件中,希望能够清除错误的 404 错误。 (编辑:这是 Google 推荐的解决方案。

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

编辑:

向 Google 帮助论坛报告:

http://www.google.com/support/forum


编辑 2:

两个站点都经过 W3C 验证,并且都不使用 PHP。


编辑3:

“/a”来自 jQuery v1.5.2 内部。这是根本原因。

在 jQuery 本身中有这一行...

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

编辑 4:

使用 robots.txt 文件阻止它。 (根据 Google 的说法,这只会将网站管理员工具抓取错误从“404”更改为“被 robots.txt 阻止”

Disallow:  /a/
Disallow:  /a

编辑 5:

以下是Google 员工 JohnMu 在 我在 Google 网上论坛发起的帖子。看来我还是要坚持301了。

穆约翰

Google 员工

凌晨 4:39

大家好

对此只有一个简短的说明 - 是的,我们
许多人都选择了“/a”链接
来自 jQuery JavaScript 的站点。然而,
这通常不是问题,如果我们
将“/a”视为 404,那么那就是
对我们来说很好。与其他 404-URL 一样,
我们会将其列为抓取错误
网站站长工具,但同样,这不是
爬行会出现问题,
索引或排名。如果你想
确保它不会触发
网站站长工具抓取错误,然后我
建议只使用 301 重定向
该 URL 到您的主页(不允许
URL 也会将其显示为
抓取错误 - 它将被列为
robots.txt 不允许的 URL)。

我也建议不明确
禁止抓取 jQuery
文件。虽然我们一般不会
单独索引它,我们可能需要
访问它以生成良好的 Instant
您网站的预览。

总结一下:如果您看到“/a”
在网站管理员的抓取错误中
工具,你可以把它留下来
那,它不会造成任何问题。如果
你想把它从那里删除,你
可以进行 301 重定向到您的
主页。

干杯

约翰

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

隔纱相望 2024-11-02 19:25:38

检查您的 Apache 错误日志。或者安装一个保存 $_SERVER["HTTP_REFERER"] 的小 PHP 文件,如下所示:

<?php

$f = fopen("logfile.txt", "a");
fwrite ($_SERVER["HTTP_REFERER"] . "\n");
fclose ($f);

然后创建一个 .htaccess 文件以将对 /a 的调用重定向到此 PHP:

Options FollowSymLinks
RewriteEngine On
RewriteRule ^a$ somthing.php

或者,您可以可以将您的 PHP 保存在名称 /a/index.php 上,这样您就不需要重定向。

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.

羁客 2024-11-02 19:25:38

执行 301 重定向或以其他方式从您的网站站长工具帐户发出 URL 删除请求。

GWT-->站点配置-->抓取访问-->网址删除请求

Do 301 redirection or otherwise do URL removal request form your web master tools account.

GWT--> Site configuration--> crawl access--> URL removal request

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文