|
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
#1 |
WHO IS FONZY!?! Don't they teach you anything at school?
Join Date: Aug 2007
Location: DE
Posts: 49
|
Sitemap autoupdate <lastmod> ?
Is it possible to auto update the <lastmod> tag since my sites are updated daily?
|
![]() |
![]() |
![]() |
#2 |
You can now put whatever you want in this space :)
|
One way is to render sitemap.xml using PHP
(.htaccess) Code:
AddType application/x-httpd-php .xml 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; ?> Code:
<url><loc>http://www.example.com</loc> <lastmod><? echo $lastmod; ?></lastmod></url>
__________________
Success is going from failure to failure without a loss of enthusiasm. |
![]() |
![]() |
![]() |
#3 |
WHO IS FONZY!?! Don't they teach you anything at school?
Join Date: Aug 2007
Location: DE
Posts: 49
|
thanks a lot will try it
![]() |
![]() |
![]() |
![]() |
#4 |
WHO IS FONZY!?! Don't they teach you anything at school?
Join Date: Aug 2007
Location: DE
Posts: 49
|
unfortunally google could not read my sitemap
![]() 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; ?> <url> <loc>http://www.hentaiprince/</loc> <lastmod><? echo $lastmod; ?></lastmod> <changefreq>hourly</changefreq> <priority>0.9</priority> </url> ... and so on </urlset> |
![]() |
![]() |
![]() |
#5 |
You can now put whatever you want in this space :)
|
You need to wrap the list of urls in <urlset>. You have </urlset> at the end but no opening <urlset>.
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.
__________________
Success is going from failure to failure without a loss of enthusiasm. |
![]() |
![]() |
![]() |
#6 |
WHO IS FONZY!?! Don't they teach you anything at school?
Join Date: Aug 2007
Location: DE
Posts: 49
|
will fix it
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | Rate This Thread |
|
|