English 中文(简体)
有活力的PHP网站......需要“最后”现场图?
原标题:Sitemap for dynamic PHP website ... the "lastmod" field is needed?
  • 时间:2009-10-18 17:27:46
  •  标签:

I ve a really small website, so I usually update the sitemap by hand! In each "url" element there are the fields: loc, lastmod, changefreq and priority.

“最后”领域建在“一号”中,更新了相关的PHP网页的内容或相关PHP网页中充满活力的内容!

I ve试图使用。 我注意到,在制作的现场地图中,“最后”领域没有。

在谷歌维基,关于如何撰写现场地图,有一份书面材料,即使有活力的页页,也为建立“最后”领域树立了好的做法;因此,我的问题是......。

是否需要“最后”领域?

亲爱!

最佳回答

该标准说,它有选择:。 http://www.sitemaps.org/protocol.php#locdef:

<lastmod>>optional

The date of last modification of the file. This date should be in W3C Datetime format. This format allows you to omit the time portion, if desired, and use YYYY-MM-DD.

然而,让搜索引擎/喷口机知道你的内容最后一次更新可能是有益的。


The How do I compute lastmod date? entry of the FAQ also gives an interesting reason, that explains why you should include the lastmod date if you can (quoting) :

Using even an approximate date or timestamp can help crawlers avoid crawling URLs that have not changed. This will reduce the bandwidth and CPU requirements for your web servers.

问题回答
$lastmod = date( Y-m-dTH:i:s+00:00 );

for more info, http://www.w3.org/TR/NOTE-datetime

您可以利用网站的功能来创造最后的单元。

How Last mode value is created enter image description here

<sitemap>
    <loc><?php echo url( / ) ?>/sitemap/uk/lse/list</loc>
    <lastmod><?php echo date( c , time()); ?></lastmod>
</sitemap>

它不是强制性的,而是让谷歌(和其他发动机)知道何时在贵网站进行内容更新。





相关问题
热门标签