【问题标题】:SEO exclude specific folder/pagesSEO 排除特定文件夹/页面
【发布时间】:2012-07-10 15:48:15
【问题描述】:

我正在构建这个网站,其中包含许多无法在移动设备上正常运行的效果,因此我们构建了一个简单的 html 版本,并在设备不支持所有效果时重定向设备。

Normal version URL: www.mysite.com/#some_page_name

Simple version URL:www.mysite.com/static.php?p=some_page_name

问题是我们不希望谷歌、必应和雅虎在搜索结果中提供简单版本的 URL,我们总是希望人们登陆网站的普通版本。

是否可以用 Apache、PHP 或 JS 告诉搜索引擎机器人忽略所有以 static.php 开头的 URL?

【问题讨论】:

    标签: php javascript apache seo robots.txt


    【解决方案1】:

    将其放入您的 robots.txt 文件中:

    User-agent: *
    Disallow: /static.php
    

    这不仅可以防止页面被机器人索引,还可以防止它们一起抓取它们。

    【讨论】:

      【解决方案2】:

      使用 robots.txt 文件,在你的情况下它看起来像

      # www.robotstxt.org/
      
      User-agent: *
      Disallow: /static.php
      

      您可以在 robots.txt here 上阅读更多信息

      【讨论】:

        【解决方案3】:

        robots.txt

        Disallow: /static.php

        Google Documentation on robots.txt

        【讨论】:

          【解决方案4】:

          您可以使用robots.txt

          User-agent: *
          Disallow: *static.php
          

          * 是一个通配符,因此这将影响 所有 名为 static.php 的页面。因此,如果您在子目录中遵循类似的范例,这也会影响它们。

          【讨论】:

            猜你喜欢
            • 2015-12-11
            • 2012-11-19
            • 1970-01-01
            • 2013-03-22
            • 2014-02-09
            • 1970-01-01
            • 1970-01-01
            • 2013-10-16
            • 1970-01-01
            相关资源
            最近更新 更多