Greenguy's Board

Greenguy's Board (http://www.greenguysboard.com/board/index.php)
-   Search Engines (http://www.greenguysboard.com/board/forumdisplay.php?f=13)
-   -   Sitemap autoupdate <lastmod> ? (http://www.greenguysboard.com/board/showthread.php?t=41929)

Den 2007-08-02 05:37 AM

Sitemap autoupdate <lastmod> ?
 
Is it possible to auto update the tag since my sites are updated daily?

Halfdeck 2007-08-02 06:17 PM

One way is to render sitemap.xml using PHP

(.htaccess)

Code:

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

Code:

$lastmod = date('Y-m-d');
$header .= "";
$header .= "         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:

http://www.example.com

Problem with this approach is all your XML files in the root directory will not show correctly in many browsers.

Den 2007-08-08 02:13 AM

thanks a lot will try it |thumb

Den 2007-08-10 11:53 AM

unfortunally google could not read my sitemap :( this is how it looks like
Code:

$lastmod = date('Y-m-d');
$header .= "";
$header .= "         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;
?>
 
      http://www.hentaiprince/
     
      hourly
      0.9
 

... and so on


Halfdeck 2007-08-10 12:53 PM

You need to wrap the list of urls in . You have at the end but no opening .

If that fix doesn't work, try validating it using an XML validator. Also use a http header checker to make sure the PHP page is generating the right code.

Den 2007-08-10 09:12 PM

will fix it


All times are GMT -4. The time now is 12:31 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc