SEO sitemap.xml动态内容

SEO sitemap.xml动态内容,seo,sitemap,dynamic-data,Seo,Sitemap,Dynamic Data,假设我们得到了这些页面: 1. http://www.mywebsite.com/users/thomas-roberts 2. http://www.mywebsite.com/pages/thomas-roberts/1 3. http://www.mywebsite.com/pages/thomas-roberts/hello-kitty-collection 是否可以在sitemap.xml中执行此操作: <?xml version="1.0" encoding="utf-8"?

假设我们得到了这些页面:

1. http://www.mywebsite.com/users/thomas-roberts
2. http://www.mywebsite.com/pages/thomas-roberts/1
3. http://www.mywebsite.com/pages/thomas-roberts/hello-kitty-collection
是否可以在sitemap.xml中执行此操作:

<?xml version="1.0" encoding="utf-8"?>

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    <url>
        <loc>http://mywebsite.com/users/^(\w+)$/</loc>
        <lastmod>2006-11-18</lastmod>
        <changefreq>daily</changefreq>
        <priority>1</priority>
    </url>
    <url>
        <loc>http://mywebsite.com/users/^(\w+)$/pages/^(\w+)$</loc>
        <lastmod>2006-11-18</lastmod>
        <changefreq>daily</changefreq>
        <priority>0.8</priority>
    </url>
    <url>
        <loc>http://mywebsite.com/users/^(\w+)$/pages/^(\d+)$</loc>
        <lastmod>2006-11-18</lastmod>
        <changefreq>daily</changefreq>
        <priority>0.6</priority>
    </url>
</urlset>

http://mywebsite.com/users/^(\w+)$/
2006-11-18
每日的
1.
http://mywebsite.com/users/^(\w+)$/页/^(\w+)$
2006-11-18
每日的
0.8
http://mywebsite.com/users/^(\w+)$/页/^(\d+)$
2006-11-18
每日的
0.6
我希望我的例子很清楚,我们并没有在sitemap.xml文件中指定一个新的“url”元素,而是将一个正则表达式与url匹配,每次都会回来更新

如果这可能不是一个解决方案,Twitter和Facebook如何在Google中为所有页面(个人资料页面等)编制索引?他们是否会在每次创建新用户时生成新的站点地图,并在每次有人更新其页面/个人资料时更新其站点地图

我非常喜欢讨价还价,如果indead能够以某种方式生成sitemap.xml(限制为50000个项目和10mb),那么如果内容被修改,生成sitemap会是一个好主意吗


非常感谢。

站点地图必须实际包含URL。正则表达式是不可接受的,而且毫无用处,因为它们不会告诉搜索引擎任何事情


网站地图只是告诉搜索引擎在哪里可以找到你的内容。因此,如果页面内容被修改,那么就搜索引擎而言,网站地图实际上不会对其产生影响。

不幸的是,网站地图文件中需要明确的URL。相反,Robots.txt文件允许某种通配符语法通过*和+符号来表示一组url,但站点地图文件并非如此。

我认为最好的办法是使用cron job运行的脚本更新数据库(或缓存)中的url。如果可以在服务器时间限制内生成sitemap.xml,则让它使用数据动态运行。有关示例,请参见此处:

但是,如果您有大量数据,那么最好是在多个站点地图中找到URL,这是允许的,只要列出了robots.txt中指定的sitemap.xml,请参见此处的详细信息: