【问题标题】:Google SEO prevent dirty parameters谷歌 SEO 防止脏参数
【发布时间】:2015-09-14 08:11:57
【问题描述】:

我们目前正在为 anguar 网站 (site.com) 使用预渲染。但是我们有一个问题。

当我们在 Google 中运行 site:site.com 时,很多搜索结果链接会像这样显示:

site.com?ref=adirtyurl.com

我们如何防止它出现在谷歌中?

我已经将此添加到我的 robots.txt 文件中,但如果这些垃圾邮件发送者开始使用不同的参数怎么办?我想尝试完全限制这一点

User-agent: *
Disallow: /*?ref=*

【问题讨论】:

  • 我投票结束这个问题,因为它是关于 SEO 的

标签: seo google-search robots.txt


【解决方案1】:

我最终编写了一些返回错误 404 的重写规则,但允许的参数除外:

    <rule name="BlockUrlParams" patternSyntax="ECMAScript" stopProcessing="true">
      <match url="(.*)" />
      <conditions>
        <add input="{QUERY_STRING}" pattern="^(?!.*\b_escaped_fragment_\b)" />
        <add input="{REQUEST_URI}" pattern="\?" />          
      </conditions>
      <action type="CustomResponse" statusCode="404" statusReason="File or directory not found." statusDescription="The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable." />
    </rule>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多