In the config file for the second site, add;
PHP Code:
define('SITEMAPXML_SITEMAPINDEX', 'sitemap_store2');
define('SITEMAPXML_DIR_WS', 'sitemap_store2');
this will tell the module to create a new file, sitemap_store2.xml and use folder sitemap_store2 (create this manually through ftp).
Next create a new file in the root of your site called robots.php and add the next lines
PHP Code:
<?php
header('Content-Type:text/plain');
echo 'Sitemap: http://' . $_SERVER['HTTP_HOST'] . '/' . SITEMAPXML_SITEMAPINDEX . '.xml' . "\r\n";
echo 'User-agent: *' . "\r\n";
echo 'Disallow: /cgi-bin/' . "\r\n";
and may be other lines from your robots.txt file.
Next create if there is no .htacces file in your root or else edit.
search for RewriteEngine On . If it is not there add it.
after thet add : RewriteRule ^robots\.txt$ /robots.php [NC,L]
Next remove robots.txt from the root of the site. Now you have a dynamically created robots.txt that can adapt to any circumstance you want.
Bookmarks