sitemap.xml
The `sitemap.xml` file is an essential component for search engine optimization (SEO) and helps search engines understand the structure of a website. Here’s a brief overview of its purpose and components:
Purpose of `sitemap.xml`:
- Provides a list of URLs on the website.
- Helps search engines discover and index content more efficiently.
- Can include metadata about each URL (e.g., last modified date, priority).
Basic Structure of `sitemap.xml`:
- urlset: The root element, usually defined with the XML namespace for sitemaps.
- url: Each URL entry is wrapped in this tag.
- loc: The URL of the page.
- lastmod: The date the page was last modified.
- changefreq: How frequently the page is likely to change (e.g., daily, weekly).
- priority: The priority of the page relative to other URLs on the site.
Sample `sitemap.xml`:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap-image">
<url>
<loc>http://www.example.com/</loc>
<lastmod>2023-10-01</lastmod>
<changefreq>monthly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>http://www.example.com/about</loc>
<lastmod>2023-09-15</lastmod>
<changefreq>yearly</changefreq>
<priority>0.5</priority>
</url>
</