设为首页收藏本站

推广学院

 找回密码
 立即注册

QQ登录

只需一步,快速开始

广告位150/月广告位150/月(速购)※广告位150/月※
查看: 4116|回复: 1
打印 上一主题 下一主题

URL规范化

[复制链接]
  • TA的每日心情
    开心
    2015-4-30 16:33
  • 签到天数: 1 天

    [LV.1]初来乍到

    70

    主题

    103

    帖子

    883

    积分

    版主

    Rank: 7Rank: 7Rank: 7

    积分
    883
    跳转到指定楼层
    楼主
    发表于 2014-4-4 20:21:52 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
    URL规范化(url normalization)其实就是一个标准化URL的过程,其实也就是将一个URL转化为一个符合规范的等价URL(如http://www.cnblogs.com/shuchao转化为http://www.cnblogs.com/shuchao/),这样程序可以确定这两个URL是等价的。
    URL规范化用于搜索引擎可以减少对页面的重复索引,同时也可以减少爬虫的重复抓取。浏览器端识别用户是否访问过一个URL也需要使用URL规范化。
    1 URL组成
    2 不规范的URL
    3 URL规范化过程
    4 SEO URL规范化
    URL组成:
    protocol :// hostname[:port] / path / [;parameters][?query]#fragment
      协议://主机名[:端口]/ 路径/[:参数] [?查询]#Fragment

    不规范的URL:
    1 URL中多余的字符
    1.1 子域名的URL中包含"www":  "http://www.example.example.com/"
    1.2 含有默认端口: "http://www.example.com:80/shuchao/"
    1.3 松散的URL: "http://www.example.indigo.ca/books/amazon-sucks-donkey-balls/9780470170779-item.html"
    1.4 多余默认文件名index.html,default.aspx等:"http://www.example.com/shuchao/index.html"
    1.5 文件路径中
         (1) 多余的"/":"http://www.cnblogs.com/shuchao//"
         (2) 多余的点修饰串:"x/y/z/http://www.cnblogs.com/a/b/http://www.example.com/../page.html"
    1.6 查询串中多余的
         (1) ? (空查询串):http://www.example.com/shuchao?
         (2) &
         (3) 无用的查询变量:http://www.example.com/display?id=123&fake=fake
    2 URL缺少字符串
    2.1 缺少"/":"http://www.example.com/example"
    2.2 查询串缺少名称或者值:"http://www.example.com/display?id=" 或者 "http://www.example.com/display?=123"
    3 其他不规范的URL
    3.1 "http://shuchao.cnblogs.com/" 与 "http://www.cnblogs.com/shuchao/"其实是相同的内容
    3.2 使用IP代替域名
    3.3 含有扩充字符(extended characters),大小写敏感("http://www.google.cn/Intl/zh-CN/about.html" 和"http://www.google.cn/intl/zh-CN/about.html")
    3.4 "+"和"%20"混用
    3.5 查询变量顺序混乱:"http://www.example.com/test.aspx?bar=1&a=test"
    3.6 含临时的状态变量:http://www.example.com/test?back=/prevpage.aspx

    URL规范化过程
    1.URL协议名和主机名小写化
    HTTP://WWW.EXAMPLE.com/test   -> http://www.example.com/test
    2.escape序列转化为大写,因为escape序列大小敏感
    %3a ->%3A
    3.删除Fragment(#)
    http://www.example.com/test/index.html#seo -> http://www.example.com/test/index.html
    4.删除空查询串的'?'
    http://www.example.com/test?  ->  http://www.example.com/test
    5.删除默认后缀
    http://www.example.com/test/index.html   ->  http://www.example.com/test/
    6.删除多余的点修复符
      http://www.example.com/../a/b/../c/./d.html -> http://www.example.com/a/c/d.html
    7.删除多余的"www"
    http://www.test.example.com/  -> http://test.example.com/
    8.对查询变量排序
    http://www.example.com/test?id=123&fakefoo=fakebarhttp://www.example.com/test?id=123 \
    9.删除取默认值的变量
    http://www.example.com/test?id=&sort=ascendinghttp://www.example.com/test
    10.删除多余的查询串,如?,&
    http://www.example.com/test?http://www.example.com/test
    11.Dust 规则(Schonfeld 等人提出的启发式方法)
    http://www.example.com/test?id=123 -> http://www.example.com/test_123
    SEO URL规范化
    不规范的URL会造成网站很多重复的URL,导致爬虫重复抓取同一内容,影响网站有效的内容被抓取,同时也就影响索引。
    多个不规范URL造成PR稀疏,本来流向同一页面的PR,结果造成了流向多个不规范的URL。
    还有一个用户体验问题,复杂或者不规范的URL容易使用户对网站造成不良印象。
    Google管理员增加了URL规范化的工具,可以删除URL中无用的参数。

    分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
    收藏收藏
    回复

    使用道具 举报

  • TA的每日心情
    开心
    2015-7-1 12:48
  • 签到天数: 1 天

    [LV.1]初来乍到

    9

    主题

    91

    帖子

    329

    积分

    营销大学生

    Rank: 6Rank: 6

    积分
    329
    沙发
    发表于 2014-4-10 11:13:32 | 只看该作者
      这个得认真对待
    www.sqseo69.com
    www.kakadaiyu
    回复 支持 反对

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    关闭

    站长推荐上一条 /1 下一条

    QQ|手机版|小黑屋|推广学院 ( 鲁ICP备13009163号  

    GMT+8, 2024-5-18 05:59 , Processed in 0.095114 second(s), 28 queries .

    Powered by Discuz! X3.2 Licensed

    © 2001-2013 Comsenz Inc.

    快速回复 返回顶部 返回列表