LinkedIn에서 Google 검색 확인하기:
LinkedIn에서 팔로우하고 검색 가능한 사이트를 만드는 방법에 관한 Google 검색 뉴스와 리소스를 확인하세요.
让您的404页面更有用
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
2008年9月2日星期二
发表者:Sahala Swenson, 网站管理员工具组
原文:
Make your 404 pages more useful
发表于:2008年8月19日星期二,上午10:13
网站的访问者会由于多种原因在访问您的网站时碰到
404“网页不存在”
的情况:
-
输错了网址,或者复制粘贴网址时出错
-
所点击的网页上或者email信息里的链接已经失效或不完整
-
该网页的内容已经被移动或删除
在碰到404页面时,访问者可能会尝试手动纠正这个错误的网址,或者点击返回按钮,甚至会直接离开您的网站。正如较早前发表在“
网站管理员中心404专题周
”的
一篇文章
中提到的,您可以采取多种方法帮助网站访问者走出这个死胡同。为了将404页面变得更加有用,我们刚刚在
网站管理员工具
里添加了“增强型404页面”工具。如果您已经创建了一个
自定义404页面
,此功能允许您在404页面嵌入一个小工具。这个小工具可以基于错误的网址提供建议,从而帮助访问者找到他们想找的东西。
举例来说:Jamie在email里收到这样一个链接
www.example.com/activities/adventurecruise.html
。由于email客户端的格式问题,这个网址被删减成
www.example.com/activites/adventur
。所以,一个404页面就自然而然地出现了。然而,在嵌入这个404小工具后,她就可以看到如下信息:
除了试着纠正错误网址以外,这个404小工具还提供下面的建议(如果可用的话):
-
一个指向上一级子目录的链接
-
一个网站地图页面
-
网站查询的建议和搜索框
那么您怎么才能添加这个小工具呢?请访问网站管理员工具的“工具”板块,其中的“增强型404页面”工具,可以让您生成一段JavaScript代码片段。您可以将其复制粘贴到您的自定义404页面的代码里。当然,请不要忘记
返回正确的404状态码
。
我可以改变它的外观吗?当然可以。我们在初始状态下没有对HTML页面进行任何修饰,但是我们已经将CSS代码部分包括进来,您可以对其进行编辑。想要了解更多这方面的信息,请查阅
更改自定义404小工具的外观的帮助文章
。
此功能目前处于实验阶段,我们可能无法为您的网站提供更多改善的建议,但我们会努力提高覆盖面。与此同时,欢迎您在文末的评论栏或者
网站管理员支持论坛
里发表您的看法。感谢您帮助我们使Internet变得更友好更便捷!
(译者注:本文译自英文网站管理员博客,所以所有图示均采用英文原图,文中提到的小工具已有中文版本,欢迎您注册
谷歌网站管理员工具
并使用“
增强型 404 页面”小工具! )
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2008-09-01。
[null,null,["最后更新时间 (UTC):2008-09-01。"],[[["\u003cp\u003eWebsite visitors encounter 404 errors due to various reasons, including mistyped URLs, broken links, or deleted content.\u003c/p\u003e\n"],["\u003cp\u003eGoogle Webmaster Tools offers a widget to enhance custom 404 pages, providing suggestions to help visitors find the desired content.\u003c/p\u003e\n"],["\u003cp\u003eThe 404 widget can suggest corrections to the URL, link to parent directories, offer a sitemap, and provide site search options.\u003c/p\u003e\n"],["\u003cp\u003eWebmasters can customize the appearance of the 404 widget using CSS, and this feature is currently experimental with ongoing improvements.\u003c/p\u003e\n"]]],["Webmaster Tools added an \"Enhance `404` pages\" section to help visitors encountering `404` errors. This feature lets users embed a widget in custom `404` pages, providing suggestions to help find the correct content. The widget attempts to correct URLs and offers links to the parent subdirectory, a sitemap, and site search suggestions. Users can add this widget via a generated JavaScript snippet from Webmaster Tools and customize its appearance with CSS.\n"],null,["# Make your 404 pages more useful\n\nTuesday, August 19, 2008\n| It's been a while since we published this blog post. Some of the information may be outdated (for example, some images may be missing, and some links may not work anymore).\n\n\nYour visitors may stumble into a\n[`404` \"Not found\"](https://google.com/not-very+found)\npage on your website for a variety of reasons:\n\n- A mistyped URL, or a copy-and-paste mistake\n- Broken or truncated links on web pages or in an email message\n- Moved or deleted content\n\n\nConfronted by a `404` page, they may then attempt to manually correct the URL, click\nthe back button, or even navigate away from your site. As hinted in an\n[earlier post](/search/blog/2008/08/farewell-to-soft-404s)\nfor\n[\"`404` week at Webmaster Central\"](/search/blog/2008/08/its-404-week-at-webmaster-central),\nthere are various ways to help your visitors get out of the dead-end situation. In our quest to\nmake `404` pages more useful, we've just added a section in\n[Webmaster Tools](https://search.google.com/search-console)\ncalled \"Enhance `404` pages\". If you've created a\n[custom `404` page](/search/docs/crawling-indexing/http-network-errors#pagegone)\nthis allows you to embed a widget in your `404` page that helps your visitors find what\nthey're looking for by providing suggestions based on the incorrect URL.\n\n\nExample: Jamie receives the link `www.example.com/activities/adventurecruise.html`\nin an email message. Because of formatting due to a bad email client, the URL is truncated to\n`www.example.com/activities/adventur`. As a result it returns a `404` page.\nWith the `404` widget added, however, she could instead see the following:\n\n\nIn addition to attempting to correct the URL, the `404` widget also suggests the\nfollowing, if available:\n\n- a link to the parent subdirectory\n- a sitemap webpage\n- site search query suggestions and search box\n\n\nHow do you add the widget? Visit the \"Enhance `404` pages\" section in Webmaster Tools,\nwhich allows you to generate a JavaScript snippet. You can then copy and paste this into your\ncustom `404` page's code. As always, don't forget to\n[return a proper `404` code](/search/blog/2008/08/farewell-to-soft-404s).\n\n\nCan you change the way it looks? Sure. We leave the HTML unstyled initially, but you can edit the\nCSS block that we've included. For more information, check out our\n[guide on how to customize the look of your `404` widget](https://www.google.com/support/webmasters/bin/answer.py?answer=100044&hl=en).\n\n\nThis feature is currently experimental---we might not provide corrections and suggestions for\nyour site but we'll be working to improve the coverage. In the meantime, let us know what you\nthink in the comments below or in our\n[group discussion](https://groups.google.com/group/Google_Webmaster_Help-Indexing/browse_thread/thread/8043e56a67baa401#).\nThanks for helping us make the Internet a more friendly place!\n\nWritten by Sahala Swenson, Webmaster Tools team"]]