JavaScript Editor Ajax software     Free javascripts 



Main Page

// generate Google sitemap
if (($target = $_GET[‘target’]) == ‘google’)
{
echo $s->getGoogle();
}
// generate Yahoo sitemap
else if ($target == ‘yahoo’)
{
echo $s->getYahoo();
}
}
However, the
sitemap.php
script will not be referenced directly, but through rewritten URLs. You
added two entries in
.htaccess
that use mod_rewrite to rewrite requests to the Yahoo! sitemap
file (
urllist.txt
) to
sitemap.php?target=yahoo
, and requests to the Google sitemap file
(
sitemap.xml
) to
sitemap.php?target=google
. Here are the rewrite rules:
RewriteRule ^sitemap.xml$ /sitemap.php?target=google [L]
RewriteRule ^urllist.txt$ /sitemap.php?target=yahoo [L]
The case study in Chapter 14 demonstrates all types of sitemaps.
Informing Google about Updates
In general, Google does a pretty good job at reading your sitemap at intervals and taking note of any
updates; however, you can tell Google that your sitemap has changed by making a request to this URL:
http://www.google.com/webmasters/sitemaps/ping?sitemap=http://seophp.example.com/
sitemap.xml
If you load this URL with a web browser you’ll simply be informed that your sitemap has been added to
the queue, and that you should register your sitemap through
http://www.google.com/webmasters/
sitemaps
if you haven’t already (see Figure 9-3).
Figure 9-3
208
Chapter 9: Sitemaps
c09.qxd:c09 10:43 208


JavaScript Editor Ajax software     Free javascripts