<?php

header("Content-Type: text/plain");
$robots = file_get_contents("robots.txt");
preg_match("/Sitemap: (.*)/", $robots, $sitemap);
$url = parse_url($sitemap[1]);

$real_sitemap = $url['scheme']."://".$_SERVER['HTTP_HOST'].$url['path'];
echo str_replace($sitemap[1], $real_sitemap, $robots);