http://www.sitemaps.org/protocol.php#submit_ping
So I tried it with Google, Yahoo and Live. But was unable to get any of them to work.To submit your Sitemap using an HTTP request (replace <searchengine_URL> with the URL provided by the search engine), iIssue your request to the following URL:
<searchengine_URL>/ping?sitemap=sitemap_url
Here is what I tried:
Code: Select all
function submitSiteMapToSearchEngine( $search_engine,$sitemap_url ){
$url = $search_engine . '/ping?sitemap=' . urlencode( $sitemap_url );
echo '<hr>Get URL:<br>' . $url;
$ch=curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
echo curl_exec ($ch);
$headers = curl_getinfo($ch);
echo '<HR><PRE>'; print_r($headers); echo '</PRE>';
curl_close ($ch);
}
submitSiteMapToSearchEngine( 'http://www.google.com','http://www.example.com/sitemapindex.xml' );Result of the above (With a different domain used)
Code: Select all
Array
(
[url] => http://www.google.com/ping?sitemap=http%3A%2F%2Fwww.example.com%2Fsitemapindex.xml
[content_type] => text/html
[http_code] => 404
[header_size] => 127
[request_size] => 120
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 0.223
[namelookup_time] => 0
[connect_time] => 0.024
[pretransfer_time] => 0.025
[size_upload] => 0
[size_download] => 1415
[speed_download] => 6345
[speed_upload] => 0
[download_content_length] => 1415
[upload_content_length] => 0
[starttransfer_time] => 0.223
[redirect_time] => 0
)