Forum Moderators: coopster
header("Content-type: text/xml");
before outputting any content. So for your problem you would
- run a query to get the desired articles
- output content type and start of xml file
- output xml for each sitemap entry
- output closing xml
you would output the xml using the print command e.g print "<url></url>";
Any questions please ask
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.google.com/schemas/sitemap/0.84">
<url>
<loc>http://www.domain.com/</loc>
<changefreq>weekly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>http://www.domain.com/inventory.php?item=X100</loc>
<changefreq>weekly</changefreq>
<priority>0.6</priority>
</url>
</urlset>
Each page that you want indexed is specified inside a <loc>. Priority is the importance of that page, 1.0 being important, to 0.1 being unimportant.