我将创建一个工具,为谷歌创建动态网站地图(以及生成一个动态网站地图索引页)。
但我找不到任何关于网站地图索引中的url必须如何的信息。我知道不必以.xml结尾。但是站点地图索引中的站点地图位置是否可以像这样?
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>http://www.example.com/sitemap1.xml?param1=someParameter¶m2=anotherParameter</loc>
<lastmod>2004-10-01T18:23:17+00:00</lastmod>
</sitemap>
</sitemapindex>
提前谢谢。
更新:
我们采用了以下解决方案。
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>http://myhost.com/sitemap1.xml</loc>
<lastmod>2015-01-28</lastmod>
</sitemap>
<sitemap>
<loc>http://myhost.com/sitemap2.xml</loc>
<lastmod>2015-01-29</lastmod>
</sitemap>
</sitemapindex>
谷歌似乎对此相当满意。至少它是有效的,谷歌也没有抱怨。您可能可以添加更多的属性(如果在sitemaps.org模式中指定了这些属性),但这会有多大的不同,我不知道。
最佳答案
创建站点地图时请参考以下规则。http://www.sitemaps.org/protocol.html
为了明确回答,允许包含url参数的动态url。loc标记中的url必须是utf-8编码的。