Basic sitemap knowledge: http://wenku.baidu.com/view/bb33f4956bec0975f424e277.htmlsee this document
Scenario:
The online and offline data volume is inconsistent, resulting in a large amount of online data, with WSG. writesitemapswithindex () added;Code, Divides the generated sitemap. xml file into multiple. There is less offline data, and WSG. writesitemapswithindex (); is not required. Due to offline testing, if this code is not commented out, no URLs added and sitemap index wocould be empty; you must add some URLs with add exception will be reported.
Solution:
Use WSG. writesitemapswithindex () to control the number of files generated by sitemap. xml. If the data volume is small, you do not need this code. Otherwise, an exception is reported. If the data volume exceeds 5 W, without WSG. writesitemapswithindex (), this code will only remove the URL exceeding 5 W, leading to missing data and no error will be reported. Therefore, when the data volume exceeds 5 W, you need to add WSG. writesitemapswithindex.
Note:
A sitemap file can contain a maximum of URLs. If the number is exceeded, you need to add an index, that is, you need to add WSG. writesitemapswithindex (). Otherwise, URLs exceeding 5 million will not be added to the sitemap file.