Sitemap Eden Rock Diving Center

Site Map

<?php
//----------------------------------------------------------------------------------
// @@@ SnapSitemap.com Remote Sitemap Script (PHP) (v20130324) @@@
// This script allow SnapSitemaps customers to serve an always up to date version
// of their sitemap from there own web server without needing to perform updates.
// Please contact support@snapsitemap with any questions.
//----------------------------------------------------------------------------------

$url = "http://www.snapsitemap.com/rpc/remote-sitemap?" . $_SERVER['QUERY_STRING'];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('X-Script-Id: 23e11d71-0ffa-4a31-a798-d43f022c235a',
'X-Script-Version: 20130324-php',
'X-Forwarded-For: ' . $_SERVER['REMOTE_ADDR'],
'X-Forwarded-For-Host: ' . $_SERVER['SERVER_NAME'],
'X-Forwarded-For-Agent: ' . $_SERVER['HTTP_USER_AGENT']) );
$html = curl_exec($ch);
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$type = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);
curl_close($ch);

if(!$html) {
header("Status: 503");
print "<html><h1>Temporarily Unavailable</h1><p>No Response</p></html>";
exit;
}

if($code != 200) {
header("Status: 503");
print "<html><h1>Temporarily Unavailable</h1><p>Status $code</p></html>";
exit;
}

header("Status: 200");
if($type) header("Content-Type: " . $type);
print $html;
?>