【问题标题】:Where did urls like domain.com/index.html come from and how to fix the 404s像 domain.com/index.html 这样的 url 来自哪里以及如何修复 404
【发布时间】:2019-07-13 15:03:59
【问题描述】:

因此,由于某种原因,爬虫不断地在现有 URL 的末尾提取带有 "/index.html" 的 URL 并报告 404。

例子:

domain.com/index.html 
domain.com/pricing/index.html 
domain.com/solutions/index.html 
domain.com/solutions/project-management/index.html

问题是,在我们的网站上,我们有例如"domain.com/pricing"。但是我们真的没有"domain.com/pricing/index.html"

我想知道:

  1. 首先是什么导致这些 URL 出现在搜索引擎上?
  2. 是否有任何快速解决方法可以将"domain.com/whatever/index.html" 之类的内容重定向到"domain.com/whatever"

这件事困扰了我一段时间!

【问题讨论】:

  • 你在使用 Apache 吗?如果是这样,您的 .htaccess 文件中有什么内容?
  • 一些爬虫会根据已经访问过的 URL 猜测常见的 url,然后尝试这些 - 你无法阻止爬虫猜测。至于如何重定向,这将根据您使用的 Web 服务器软件而有所不同 - Apache、NGINX、Lighttpd、IIS 等,因此值得在您的问题中包含这些信息。
  • 我认为是 nginx。这是我们的 .htaccess 文件中的内容 # BEGIN WordPress RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule 。 /index.php [L] # 结束 WordPress

标签: html redirect seo http-status-code-404


【解决方案1】:

在我看来,不允许 Google 索引您的页面的最佳选择是添加元:

<meta name="robots" content="noindex">
<meta name="googlebot" content="noindex">

要重定向,你必须通过 cPanel 来完成

【讨论】:

  • 例如,我希望谷歌索引 domain.com/pricing,而不是 domain.com/pricing/index.html
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-06-04
  • 2021-11-14
相关资源
最近更新 更多