• robots.txt使用和优化技巧


    一、利于网站优化的robots.txt使用技巧

    1、在线建站提供方便之路。当我们将域名解析到服务器,可以访问站点了,可是这个时候站点还没有布局好,meta标签还一塌糊涂。乳沟此时的站点被 搜索引擎蜘蛛抓取收录了,到时再更改就很不利于SEO优化。这时就可以利用robots.txt文件来设置所有搜索引擎蜘蛛不允许查询站点的所有内容。其 语法格式为:

    User-agent: *
    Disallow: / 

    2、定制搜索引擎蜘蛛抓取指定内容,能让你根据站点情况来选择怎样和搜索引擎打交道。这里有两层意思。

    (1)定制搜索引擎。如果你不屑度娘的所作所为的话,可以这样子让它只能对你吹胡子瞪眼。其语法格式为:

    User-agent: baiduspider
    Disallow: /

    注:常见的搜索引擎机器人名称。

    名称                                              搜索引擎
    Baiduspider                               http://www.baidu.com
    Scooter                                       http://www.altavista.com
    ia_archiver                                 http://www.alexa.com
    Googlebot                                  http://www.google.com
    FAST-WebCrawler                   http://www.alltheweb.com
    Slurp                                           http://www.inktomi.com
    MSNBOT                                    http://search.msn.com

    (2)定制站点内容。也就是说你可以指定某个目录允许spider爬行,某个目录禁止spider爬行。如所有搜索引擎蜘蛛,允许抓取目录abc下的内容,禁止抓取目录def下的内容,其语法格式为:

    User-agent: * 
    Allow: /abc/
    Disallow: /def/

    3、引导搜索引擎抓取网站内容。这里最典型的做法有

    (1)引导蜘蛛抓取你的网站地图。其语法格式为:

     User-agent: * 
     sitemap:sitemap-url

    (2)防止蜘蛛抓取你的网站重复内容。

    4、404错误页面问题。如果你的服务器自定应了404错误页面而在你站点根目录没有配置robots.txt文件,那么搜索引擎蜘蛛会将其视为robots.txt文件,这将影响搜索引擎对你网站页面的收录。

    二、特定程序建站robots.txt的写法。这里只是提供通用的,具体的情况自己斟酌哦。

    1、DedeCMS建站的robots.txt文件写法

    User-agent: *
    Disallow: /plus/feedback_js.php
    Disallow: /plus/feedback.php
    Disallow: /plus/mytag_js.php
    Disallow: /plus/rss.php
    Disallow: /plus/search.php
    Disallow: /plus/recommend.php
    Disallow: /plus/stow.php
    Disallow: /plus/count.php
    Disallow: /include
    Disallow: /templets
    Disallow: /member

    2、WordPress建站的robots.txt文件写法

    User-agent: *
    Disallow: /wp-admin
    Disallow: /wp-content/plugins
    Disallow: /wp-content/themes
    Disallow: /wp-includes
    Disallow: /?s=
    Sitemap: http://www.***.com/sitemap.xml

    3、phpcms建站的robots.txt文件写法

    User-agent: *
    Disallow: /admin
    Disallow: /data
    Disallow: /templates
    Disallow: /include
    Disallow: /languages
    Disallow: /api
    Disallow: /fckeditor
    Disallow: /install
    Disallow: /count.php
    Disallow: /comment
    Disallow: /guestbook
    Disallow: /announce
    Disallow: /member
    Disallow: /message
    Disallow: /spider
    Disallow: /yp
    Disallow: /vote
    Disallow: /video

    4、discuz论坛的robots.txt文件写法

    User-agent: * 
    Allow: /redirect.php 
    Allow: /viewthread.php 
    Allow: /forumdisplay.php 
    Disallow: /? 
    Disallow: /*.php

    转载自:http://www.chinaz.com/web/2011/0324/167374.shtml

  • 相关阅读:
    Android开发日志问题
    Android 常用的快捷键(随时更新)
    Android v4 包和v7包问题
    mongoDB 3.0.3 以上GUI 连接认证问题
    python(6)
    python学习(5)
    01_数字滤波器调研
    动态称重数据处理算法及其在禽蛋和类球形水果分选中的应用研究-01
    点云学习
    10-视频图像读取与保存
  • 原文地址:https://www.cnblogs.com/toughlife/p/5475298.html
Copyright © 2020-2023  润新知