<?php
/**
* Dynamic sitemap — served at the public URL /sitemap.xml via .htaccess.
* Uses SITE_URL from config/site-config.php, so if the domain ever
* changes, this file needs NO edits — just update SITE_URL once.
*/
require_once __DIR__ . '/config/site-config.php';
header('Content-Type: application/xml; charset=utf-8');
// path => priority. Add/remove pages here only — no domain, no .php.
$pages = [
'/' => '1.0',
'/features' => '0.9',
'/pricing' => '0.9',
'/contact' => '0.8',
'/privacy-policy' => '0.3',
'/terms-and-conditions' => '0.3',
'/refund-and-cancellation-policy' => '0.3',
];
echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
echo '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' . "\n";
foreach ($pages as $path => $priority) {
$loc = htmlspecialchars(rtrim(SITE_URL, '/') . $path);
echo " <url><loc>{$loc}</loc><priority>{$priority}</priority></url>\n";
}
echo '</urlset>';