<?php
$host = $_SERVER['HTTP_HOST'] ?? '';
$scheme = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? 'https' : 'http';
$baseUrl = $host ? ($scheme . '://' . $host) : '';
header('Content-Type: application/xml; charset=utf-8');
$urls = ['/', '/products/', '/solutions/', '/cases/', '/news/', '/resources/', '/tech/', '/community/', '/customer/', '/about/', '/contact/'];
echo '<?xml version="1.0" encoding="UTF-8"?>' . "
";

foreach ($urls as $u) {
  echo '  <url><loc>' . htmlspecialchars($baseUrl . $u, ENT_XML1, 'UTF-8') . '</loc><lastmod>' . date('Y-m-d') . '</lastmod><changefreq>weekly</changefreq><priority>' . ($u === '/' ? '1.0' : '0.8') . '</priority></url>' . "
";
}
echo '</urlset>';
?>