View Single Post
Old 2007-08-02, 06:17 PM   #1
Halfdeck
You can now put whatever you want in this space :)
 
Halfdeck's Avatar
 
Join Date: Oct 2004
Location: New Haven, CT
Posts: 985
Send a message via ICQ to Halfdeck
One way is to render sitemap.xml using PHP

(.htaccess)

Code:
AddType application/x-httpd-php .xml
Then inside your XML file:

Code:
<?php
$lastmod = date('Y-m-d');
$header .= "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
$header .= "<urlset xmlns=\"http://www.google.com/schemas/sitemap/0.84\"
	xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
	xsi:schemaLocation=\"http://www.google.com/schemas/sitemap/0.84
	http://www.google.com/schemas/sitemap/0.84/sitemap.xsd\">";
echo $header;
?>
then include $lastmod in XML:

Code:
<url><loc>http://www.example.com</loc>
<lastmod><? echo $lastmod; ?></lastmod></url>
Problem with this approach is all your XML files in the root directory will not show correctly in many browsers.
__________________
Success is going from failure to failure without a loss of enthusiasm.
Halfdeck is offline   Reply With Quote