• 网页SEO内容


    关于网页根目录下的robots.txt文件的部分疑问

    robots.txt
    书写语法:
    第一条:User-agent,后接搜索引擎的蜘蛛名称
    第二条:Disallow,填写要拦截的部分
    经典语法:
    User-agent:*
    Disallow:

    or

    User-agent:*
    Allow:/

    User-agent:*
    Disallow:/

    User-agent:Baiduspider
    Disallow:/

    User-agent:BaiduspiderDisallow:
    User-agent:*Disallow:/

    User-agent:*
    Disallow:/admin/
    Allow:/images/

    User-agent:*
    Disallow:/admin/*.php$
    Allow:/admin/*.asp$

    User-agent:*Disallow:/*?*

    在对 robots.txt 文件设置记录时,要特别注意 Disallow 与 Allow 行的顺序是有意义的,spider 会根据第一个匹配成功的 Allow 或 Disallow 行确定是否访问某个URL。
    举例说明:
    允许 spider 访问 /cgi-bin/ 目录下的包含 see 的文件夹或URL
    User-agent: *
    Allow: /cgi-bin/see
    Disallow: /cgi-bin/
    如果Allow 和 Disallow 的顺序调换一下:
    User-agent: *
    Disallow: /cgi-bin/
    Allow: /cgi-bin/see
    spider 就无法访问到 /cgi-bin/ 目录下的包含 see 的文件夹或URL,因为第一个 Disallow: /cgi-bin/ 已经匹配成功。

    Disallow 和 Allow 记录后面可以是一条完整的路径,也可以是路径的非空前缀。例如 “Disallow: /help” 禁止 spider 访问/help.html、/helpabc.html、/help/index.html;而 “Disallow:/help/” 则允许 spider 访问 /help.html、/helpabc.html,不能访问 /help/index.html

    我要坚持一年,一年后的成功才是我想要的。
  • 相关阅读:
    ActionForm补充
    ActionForward
    struts模式匹配
    ActionMapping
    struts1.x的国际化
    DispatchAction
    ActionForm作为类型转换
    struts自定义异常
    hibernate核心接口
    Visual C# 2008+SQL Server 2005 数据库与网络开发 9.5 小结
  • 原文地址:https://www.cnblogs.com/tianxia2s/p/4999361.html
Copyright © 2020-2023  润新知