Google站点地图索引 - 包含参数的站点地图位置

问题描述 投票:2回答:2

我即将创建一个工具来为谷歌创建动态站点地图(并生成动态站点地图索引页面)。

但我找不到有关站点地图索引中的URL如何必须的任何信息。我知道它不必以.xml结尾。但站点地图索引中的站点地图位置是否如下所示?

<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">

  <sitemap>

    <loc>http://www.example.com/sitemap1.xml?param1=someParameter&param2=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模式中指定的)但是它会做多少差异,我不知道。

xml seo sitemap google-webmaster-tools
2个回答
1
投票

创建站点地图时请参阅以下规则。 http://www.sitemaps.org/protocol.html

具体来说,允许包含URL参数的动态URL。但是loc标签中的URL必须是UTF-8编码的。


0
投票

我认为这不会是一个问题,因为谷歌仍然可以获得附加参数的XML文件。我建议您通过网站管理员工具对其进行测试,看看它是否有效。提交网站的站点地图并等待页面是否被编入索引 - 可能需要一两天,但他们会告诉您提交内容是否有任何错误或问题。

我虽然有点困惑。站点地图本身的文件名必须是XML文件,但XML文档中的代码应指向站点的网页,如下所示:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>http://www.site.com/index.html</loc>
    <lastmod>2013-05-02</lastmod>
    <changefreq>monthly</changefreq>
    <priority>0.8</priority>
  </url>
  <url>
    <loc>http://www.site.com/about.html</loc>
    <lastmod>2013-05-02</lastmod>
    <changefreq>monthly</changefreq>
    <priority>0.5</priority>
  </url>
</urlset>

了解loc标签如何显示html网页。为什么你的loc标签显示xml页面?

© www.soinside.com 2019 - 2024. All rights reserved.