sitemap.xml
<?php
header("Content-Type: text/xml");
$xml = file_get_contents($_SERVER['DOCUMENT_ROOT']."/sitemap.xml");
$xml = preg_replace("/<lastmod>.*<\/lastmod>/", "<lastmod>".date("Y-m-d", strtotime('-1 days'))."</lastmod>", $xml);
echo $xml;
// RewriteRule ^sitemap\.xml$ /sitemap.php [L]