I created a sitemap for shared hosting..
<?php
$servername = "localhost";
$username = "***";
$password = "***";
$dbname = "***";
// bağlantı oluşturuyoruz
$conn = new mysqli($servername, $username, $password, $dbname);
$sql = "SELECT * FROM sidiscussions";
$result = $conn->query($sql);
?>
<?php header('Content-type: application/xml; ',true); ?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<?php while($row = $result->fetch_assoc()) { ?>
<url>
<loc><?php echo 'https://yourdomain/d/' .$row["id"]. '-' .$row["slug"]; ?></loc>
<changefreq>weekly</changefreq>
<priority>0.7</priority>
</url>
<?php } ?>
</urlset>
Save as "sitemap.php" send to ftp public director.
add .htaccess
RewriteEngine On
RewriteRule ^sitemap\.xml/?$ sitemap.php
http://yourdomain.com/sitemap.php (auto refresh) 🙂
Demo: https://www.sirdosyasi.com/sitemap.xml