Reputation: 387
I wan't to let robot knows that https://my-site.com/example/{any_num} uri should be parsed.
Here is my current part of Sitemap code.
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://my-site.com/example/</loc>
<lastmod>2016-12-14</lastmod>
<changefreq>weekly</changefreq>
<priority>1</priority>
</url>
I tried to find how to express regex in Sitemap.xml at https://www.sitemaps.org page, but i couldn't.
How can i express above regex in Sitemap.xml?
Upvotes: 2
Views: 1579
Reputation: 10539
You can't, because it doesn't make sense.
Look at it this way: If you'd want a search engine to index https://my-site.com/example/{any_num}
, you'd probably like to use the regular expression \d+
for {any_num}
. But what range of values exactly would you expect the search engine's robot to try for \d+
? Maybe from 1 to 256? From 1 to 65536? 1 to 4294967296 or even more? Neither the search engine operator nor you would be particularly happy about wasting the search engine robot's resources and hammering your site at the same time, by firing a possibly infinite number of requests against your server.
Therefore, if you're providing a dynamic set of pages you want to be indexed, dynamically generate the associated sitemaps.xml
as well.
Upvotes: 3