Here is a patch solution for users that cannot use htaccess rules.
The main problem is that Google Sitemap dont accept urls that are in another levels of the sitemap url location.
For example, if your sitemap are on http://www.yoursite.com/index.php/weblog/sitemap/, urls like http://www.yoursite.com/index.php/weblog/, http://www.yoursite.com/index.php/members/, http://www.yoursite.com/ wont be acepted.
Because of this, the desired location of our sitemap will be the root path, without any “folder” (including index.php as “folder”).
EE dont leave to do this, but we can do that with a simple PHP script.
1-. Create a template, for example on /weblog/sitemap, like is explained on here
2-. The url of your sitemap will be http://www.yoursite.com/index.php/weblog/sitemap/ or similar.
3-. Create a sitemap.php file and put it on your root path, the url of that file will be http://www.yoursite.com/sitemap.php
4-. The sitemap.php file must content:
<?php
// Prevent content to be cached
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Content was generated on past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); //Content is always modified
// Inform user agent that content is XML and is UTF-8 encoded
header('Content-type: text/xml; charset=UTF-8');
// Read content from template and show it
@readfile ('http://www.yoursite.com/index.php/weblog/sitemap/');
?>
5-. Now http://www.yoursite.com/sitemap.php url are a clon of your template, use it on Google Sitemap.
Notes: The template load by “readfile” function would be ineficient on very very large sites, on medium sites it is light becouse the execution will produce once a day more or less. In fact the template load by “readfile” function is always “local” but using “http” protocol (PHP interpreter and your site are normally on the same machine or network cluster).
If you experiment load problems becouse your site is very very large you could try to do this:
Write on “/weblog/sitemap/” template a PHP code that wrotes the content on a sitemap.xml file placed on root path. (If you write that code please post it for all community
)
That is a very efficient method, but you must execute the template regularly. For example via Cron daemon or Windows tasks equivalent.
If you cant access to Cron daemon or similar you can use some web services like:
http://www.webcron.org/
http://www.manucorp.com/
http://www.cronjob.de/
Pelase, excuse my terrible english 