【问题标题】:Does the fact that every page is reachable through www.example.com and www.example.com/index have any SEO impact?通过 www.example.com 和 www.example.com/index 可以访问每个页面这一事实是否会对 SEO 产生任何影响?
【发布时间】:2016-04-13 09:06:52
【问题描述】:

我们的网站是用 .NET MVC 编写的,每个页面都可以通过 URL www.example.com/whateverwww.example.com/whatever/index 访问(因为每个控制器的默认操作称为索引)。这对 SEO 有影响吗?

是否可以禁用显式键入 /index 的 URL(并为这些 URL 返回 404)?这安全吗?

是否应该有从www.example.com/whatever/indexwww.example.com/whatever 的重定向?

【问题讨论】:

    标签: asp.net-mvc seo


    【解决方案1】:

    是的,这将对 SEO 产生影响。像 Google 这样的搜索引擎不喜欢看到duplicated content

    我要说明的是,如果您不在任何地方链接到 /index,就不太可能找到它。例如。如果您始终使用www.example.com/whatever 版本,则不会发现www.example.com/whatever/index

    是的,您可以禁用/index 页面,这样做非常安全。 只要您不需要在路线上提供id 参数。

    正如您所建议的,您可以将/index 重定向到/ 是一种解决方案。为此,我可能会在 IIS 中使用 URL Rewrite 之类的东西。规则如下所示:

    <rule name="RemoveTrailingSlashRule1" stopProcessing="true">
      <match url="(.*)/index$" />
      <conditions>
        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
      </conditions>
      <action type="Redirect" url="{R:1}" />
    </rule>
    

    我自己,我可能会使用 canonical url 并完成它:

    <html>
      <head>
        <link rel="canonical" href="http://example.com/whatever" />
      </head>
    <body>
    

    【讨论】:

    • 如何禁用所有页面的 /index?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-01-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多