No URLs added of sitemapgen4j, sitemap index wocould be empty; you must add some URLs with add exception

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.