search
Homephp教程PHP开发网站优化不能忽略的环节环节--网站地图

   新站上线了,站长们不能忽略的一个网站优化环节--网站地图。


       Sitemap 可以让管理员通知搜索引擎他们网站上有哪些可供抓取的网页。最简单的 Sitepmap 形式,就是 XML 文件,在其中列出网站中的网址以及关于每个网址的其他元数据(上次更新的时间、更改的频率以及相对于网站上其他网址的重要程度为何等),以便搜索引擎可以更加智能地抓取网站。


下面以Google搜索引擎为例讲解一下。


Google Sitemap协议
Google SiteMap Protocol是google自己推出的一种站点地图协议,此协议文件基于早期的robots.txt文件协议,并有所升级。在Google官方指南中指出加入了Google SiteMap文件的网站将更有利于google网页爬行机器人的爬行索引,这样将提高索引网站内容的效率和准确度。文件协议应用了简单的XML格式,一共用到6个标签,其中关键标签包括链接地址、更新时间、更新频率和索引优先权。
我们来看看Google Sitemap的XML格式以及它的6个标签是什么样子的。
下面是我用站长网站生成工具获取本站首页的sitemap.xml


<?xml version="1.0" encoding="UTF-8" ?> 
- <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
- <url>
  <loc>http://www.w3note.com</loc> <!--更新频率daily -->
  <lastmod>2012-09-14</lastmod> <!--该页面的最后更新时间 -->
  <changefreq>daily</changefreq>  <!--更新频率daily -->
  <priority>0.6</priority> <!--告诉搜索引擎抓取的优先级,数字越大,优先级越高-->
  </url>
  </urlset>

 


     xml标签节点的意义:
        

          大于号  > > >

         小于号     
   标签是用来指定该链接的最后更新时间,这个很重要。Google的机器人会在索引此链接前先和上次索引记录的最后更新时间进行比较,如果时间一样就会跳过不再索引。所以如果你的链接内容基于上次Google索引时的内容有所改变,应该更新该时间,让Google下次索引时会重新对该链接内容进行分析和提取关键字。
       年:YYYY(2005)
  年和月:YYYY-MM(2005-06)
  年月日:YYYY-MM-DD(2005-06-04)
  年月日小时分钟:YYYY-MM-DDThh:mmTZD(2005-06-04T10:37+08:00)
  年月日小时分钟秒:YYYY-MM-DDThh:mmTZD(2005-06-04T10:37:30+08:00)
  这里需注意的是TZD,TZD指定就是本地时间区域标记,中国是+08:00
    
       标签告诉Google此链接可能会出现的更新频率,比如首页肯定就要用always(经常),而对于很久前的链接或者不再更新内容的链接就可以用yearly(每年)。这里可以用来描述的单词共这几个:"always", "hourly", "daily", "weekly", "monthly", "yearly","never"。
         
   是用来指定此链接相对于其他链接的优先权比值,此值定于0.0 - 1.0之间,一个网页的默认优先级为 0.5。


                   

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.