<?php
header('Content-Type: application/xml; charset=utf-8');

$scheme = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? 'https' : 'http';
$domain = $_SERVER['HTTP_HOST'];
$base = "$scheme://$domain";
$today = date('Y-m-d');

// Страницы — редактируй только этот массив под конкретный сайт
$pages = [
    ['loc' => '/',              'priority' => '1.0', 'changefreq' => 'daily'],
    ['loc' => '/about/',        'priority' => '0.7', 'changefreq' => 'monthly'],
    ['loc' => '/contact/',      'priority' => '0.4', 'changefreq' => 'monthly'],
    ['loc' => '/privacy/',      'priority' => '0.3', 'changefreq' => 'yearly'],
    ['loc' => '/responsible/',  'priority' => '0.4', 'changefreq' => 'monthly'],
    ['loc' => '/support/',      'priority' => '0.5', 'changefreq' => 'monthly'],
    ['loc' => '/terms/',        'priority' => '0.3', 'changefreq' => 'yearly'],
    ['loc' => '/amp/',          'priority' => '0.6', 'changefreq' => 'daily'],
];

// /play/ не включаем — он в Disallow robots.txt

echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<?php foreach ($pages as $page): ?>
  <url>
    <loc><?= $base . $page['loc'] ?></loc>
    <lastmod><?= $today ?></lastmod>
    <changefreq><?= $page['changefreq'] ?></changefreq>
    <priority><?= $page['priority'] ?></priority>
  </url>
<?php endforeach; ?>
</urlset>