Dealing With Google Sitemap

October 19, 2006 | Technical Stuffs

When I use Webmaster Tools from Google, it requires sitemap of my site. There are several formats allowed, easiest one is RSS 2.0 format. I already have it as my blog feeds.

Then I realize that it need to be in the root directory, while my blog have the XML file within “feeds/” directory. Changing my code will be a pain, so I decided to do some trick.

I simply create a PHP file in the root directory which read the RSS file and echo its content.: // sitemap.php
$feeds = "feeds/rss.xml";
$read = fopen($feeds,"r");
$isi = fread($read,filesize($feeds));
echo $isi;
?>

Then I open my Google’s Webmaster Tool page and submit sitemap.php instead of my RSS file. And the best thing is, it works as I expected ^_*

 

No comment

This post has no comments, you can be the first!

 

Leave a comment

Allowed tags are: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


 



Switch to our mobile site