[RESOLU]problème sitemap et google webmaster tools

bg62bg62 Member
juillet 2012 modifié dans Bogues
bonjour,
mon sitemap, généré par PluXml
http://blog.unesourisetmoi.info/sitemap.php
est de plus en plus mal pris en compte par Google
plus de la moitié des urls sont en erreur ... la galère ...
765 erreurs détectées .... !!!!
exemple :
Erreurs
	
Date non valide
	
Date incorrecte détectée. Corrigez cette date ou son format avant de réessayer.
	
764
	
Balise parent : url
Tag : lastmod
Valeur : 201207192202
	
83
	
21 juil. 2012
Balise parent : url
Tag : lastmod
Valeur : 201207181519
	
90
	
21 juil. 2012
Balise parent : url
Tag : lastmod
Valeur : 201207151428

que ce pastis ???
@+

le code du fichier sitemap.php :
<?php
# ------------------ BEGIN LICENSE BLOCK ------------------
#
# This file is part of PluXml : http://www.pluxml.org
#
# Copyright (c) 2010-2011 Stephane Ferrari and contributors
# Copyright (c) 2008-2009 Florent MONTHEL and contributors
# Copyright (c) 2006-2008 Anthony GUERIN
# Licensed under the GPL license.
# See http://www.gnu.org/licenses/gpl.html
#
# ------------------- END LICENSE BLOCK -------------------

include('config.php');

# Définition des constantes
define('PLX_ROOT', './');
define('PLX_CORE', PLX_ROOT.'core/');
define('PLX_PLUGINS', PLX_ROOT.'plugins/');
define('PLX_CONF', PLX_ROOT.'data/configuration/parametres.xml');

# On verifie que PluXml est installé
if(!file_exists(PLX_CONF)) {
	header('Location: '.PLX_ROOT.'install.php');
	exit;
}

# On inclut les librairies nécessaires
include(PLX_CORE.'lib/class.plx.date.php');
include(PLX_CORE.'lib/class.plx.glob.php');
include(PLX_CORE.'lib/class.plx.utils.php');
include(PLX_CORE.'lib/class.plx.capcha.php');
include(PLX_CORE.'lib/class.plx.erreur.php');
include(PLX_CORE.'lib/class.plx.record.php');
include(PLX_CORE.'lib/class.plx.motor.php');
include(PLX_CORE.'lib/class.plx.plugins.php');

# On impose le charset
header('Content-Type: text/xml; charset='.PLX_CHARSET);

# Creation de l'objet principal et lancement du traitement
$plxMotor = plxMotor::getInstance();

# Chargement du fichier de langue
loadLang(PLX_CORE.'lang/'.$plxMotor->aConf['default_lang'].'/core.php');

$plxMotor->prechauffage();
$plxMotor->demarrage();

# Entête XML
echo '<?xml version="1.0" encoding="'.strtolower(PLX_CHARSET).'" ?>'."\n";
?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
	<url>
		<loc><?php echo $plxMotor->urlRewrite() ?></loc>
		<changefreq>weekly</changefreq>
		<priority>1.0</priority>
	</url>
<?php
# Les pages statiques
foreach($plxMotor->aStats as $stat_num => $stat_info) {
	if($stat_info['active']==1 AND $stat_info['menu']=='oui' AND $stat_num!=$plxMotor->aConf['homestatic']) {
		echo "\n";
		echo "\t<url>\n";
		echo "\t\t<loc>".$plxMotor->urlRewrite("?static".intval($stat_num)."/".$stat_info['url'])."</loc>\n";
		echo "\t\t<changefreq>monthly</changefreq>\n";
		echo "\t\t<priority>0.8</priority>\n";
		echo "\t</url>\n";
	}
}
eval($plxMotor->plxPlugins->callHook('SitemapStatics'));
# Les catégories
foreach($plxMotor->aCats as $cat_num => $cat_info) {
	if($cat_info['active']==1 AND $cat_info['menu']=='oui' AND ($cat_info['articles']!=0 OR $plxMotor->aConf['display_empty_cat'])) {
		echo "\n";
		echo "\t<url>\n";
		echo "\t\t<loc>".$plxMotor->urlRewrite("?categorie".intval($cat_num)."/".$cat_info['url'])."</loc>\n";
		echo "\t\t<changefreq>weekly</changefreq>\n";
		echo "\t\t<priority>0.8</priority>\n";
		echo "\t</url>\n";
	}
}
eval($plxMotor->plxPlugins->callHook('SitemapCategories'));
# Les articles
if($aFiles = $plxMotor->plxGlob_arts->query('/^[0-9]{4}.[home|'.$plxMotor->activeCats.',]*.[0-9]{3}.[0-9]{12}.[a-z0-9-]+.xml$/','art','rsort', 0, false, 'before')) {
	$plxRecord_arts = false;
	$array=array();
	foreach($aFiles as $k=>$v) { # On parcourt tous les fichiers
		$array[ $k ] = $plxMotor->parseArticle(PLX_ROOT.$plxMotor->aConf['racine_articles'].$v);
	}
	# On stocke les enregistrements dans un objet plxRecord
	$plxRecord_arts = new plxRecord($array);
	if($plxRecord_arts) {
		# On boucle sur nos articles
		while($plxRecord_arts->loop()) {
			$num = intval($plxRecord_arts->f('numero'));
			echo "\n";
			echo "\t<url>\n";
			echo "\t\t<loc>".$plxMotor->urlRewrite("?article".$num."/".plxUtils::strCheck($plxRecord_arts->f('url')))."</loc>\n";
			echo "\t\t<lastmod>".$plxRecord_arts->f('date')."</lastmod>\n";
			echo "\t\t<changefreq>monthly</changefreq>\n";
			echo "\t\t<priority>0.5</priority>\n";
			echo "\t</url>\n";
		}
	}
}
eval($plxMotor->plxPlugins->callHook('SitemapArticles'));
?>
</urlset>

Réponses

  • StéphaneStéphane Member, Former PluXml Project Manager
    Salut

    Utilises le bon fichier sitemap.php et ça ira tout de suite mieux.
    D'apres le code du fichier que tu as mis dans ton post, ce n'est pas celui de la 5.1.6 de PluXml.

    Consultant PluXml

    Ancien responsable du projet (2010 à 2018)

  • bg62bg62 Member
    juillet 2012 modifié
    Stéphane a écrit:
    Salut

    Utilises le bon fichier sitemap.php et ça ira tout de suite mieux.
    D'apres le code du fichier que tu as mis dans ton post, ce n'est pas celui de la 5.1.6 de PluXml.
    merci stéphane ;)
    je viens de télécharger et de remplacer par la dernière version ( ... je ne vois pas trop la différence ...)
    et pour Google lorsque je teste j'ai encore ceci :
    Erreurs

    Date non valide

    Date incorrecte détectée. Corrigez cette date ou son format avant de réessayer.

    765

    Balise parent : url
    Tag : lastmod
    Valeur : 201207211642

    83

    22 juil. 2012
    Balise parent : url
    Tag : lastmod
    Valeur : 201207192202

    90

    22 juil. 2012
    Balise parent : url
    Tag : lastmod
    Valeur : 201207181519

    97

    22 juil. 2012

    et pourtant quand je regarde d'autres sites ... les dates y sont bien affichées ^^
    genre
    "<lastmod>2012-04-17</lastmod><changefreq>monthly</changefreq><priority>0.5</priority>"
    alors que moi j'ai toujours :
    "<lastmod>201207211642</lastmod><changefreq>monthly</changefreq><priority>0.5</priority>"

    donc ça doit venir d'ailleurs mais de où .... ???

    tu y comprends qq chose ?
  • StéphaneStéphane Member, Former PluXml Project Manager
    Ton fichier sitemap.php n'est pas le bon. Pas besoin de chercher plus loin pour trouver d'autres explications.

    Consultant PluXml

    Ancien responsable du projet (2010 à 2018)

  • bg62bg62 Member
    juillet 2012 modifié
    Stéphane a écrit:
    Ton fichier sitemap.php n'est pas le bon. Pas besoin de chercher plus loin pour trouver d'autres explications.
    comprends toujours pas ....
    5 téléchargements + tests en local + 2 mises en ligne et toujours pareil !!!
    voici celui qui s'y trouve (extrait de "pluxml-latest.zip" à l'instant (5.1.6):
    <?php
    # ------------------ BEGIN LICENSE BLOCK ------------------
    #
    # This file is part of PluXml : http://www.pluxml.org
    #
    # Copyright (c) 2010-2011 Stephane Ferrari and contributors
    # Copyright (c) 2008-2009 Florent MONTHEL and contributors
    # Copyright (c) 2006-2008 Anthony GUERIN
    # Licensed under the GPL license.
    # See http://www.gnu.org/licenses/gpl.html
    #
    # ------------------- END LICENSE BLOCK -------------------
    
    include('config.php');
    
    # Définition des constantes
    define('PLX_ROOT', './');
    define('PLX_CORE', PLX_ROOT.'core/');
    define('PLX_PLUGINS', PLX_ROOT.'plugins/');
    define('PLX_CONF', PLX_ROOT.'data/configuration/parametres.xml');
    
    # On verifie que PluXml est installé
    if(!file_exists(PLX_CONF)) {
    	header('Location: '.PLX_ROOT.'install.php');
    	exit;
    }
    
    # On inclut les librairies nécessaires
    include(PLX_CORE.'lib/class.plx.date.php');
    include(PLX_CORE.'lib/class.plx.glob.php');
    include(PLX_CORE.'lib/class.plx.utils.php');
    include(PLX_CORE.'lib/class.plx.capcha.php');
    include(PLX_CORE.'lib/class.plx.erreur.php');
    include(PLX_CORE.'lib/class.plx.record.php');
    include(PLX_CORE.'lib/class.plx.motor.php');
    include(PLX_CORE.'lib/class.plx.plugins.php');
    
    # On impose le charset
    header('Content-Type: text/xml; charset='.PLX_CHARSET);
    
    # Creation de l'objet principal et lancement du traitement
    $plxMotor = plxMotor::getInstance();
    
    # Chargement du fichier de langue
    loadLang(PLX_CORE.'lang/'.$plxMotor->aConf['default_lang'].'/core.php');
    
    $plxMotor->prechauffage();
    $plxMotor->demarrage();
    
    # Entête XML
    echo '<?xml version="1.0" encoding="'.strtolower(PLX_CHARSET).'" ?>'."\n";
    ?>
    <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    	<url>
    		<loc><?php echo $plxMotor->urlRewrite() ?></loc>
    		<changefreq>weekly</changefreq>
    		<priority>1.0</priority>
    	</url>
    <?php
    # Les pages statiques
    foreach($plxMotor->aStats as $stat_num => $stat_info) {
    	if($stat_info['active']==1 AND $stat_info['menu']=='oui' AND $stat_num!=$plxMotor->aConf['homestatic']) {
    		echo "\n";
    		echo "\t<url>\n";
    		echo "\t\t<loc>".$plxMotor->urlRewrite("?static".intval($stat_num)."/".$stat_info['url'])."</loc>\n";
    		echo "\t\t<changefreq>monthly</changefreq>\n";
    		echo "\t\t<priority>0.8</priority>\n";
    		echo "\t</url>\n";
    	}
    }
    eval($plxMotor->plxPlugins->callHook('SitemapStatics'));
    # Les catégories
    foreach($plxMotor->aCats as $cat_num => $cat_info) {
    	if($cat_info['active']==1 AND $cat_info['menu']=='oui' AND ($cat_info['articles']!=0 OR $plxMotor->aConf['display_empty_cat'])) {
    		echo "\n";
    		echo "\t<url>\n";
    		echo "\t\t<loc>".$plxMotor->urlRewrite("?categorie".intval($cat_num)."/".$cat_info['url'])."</loc>\n";
    		echo "\t\t<changefreq>weekly</changefreq>\n";
    		echo "\t\t<priority>0.8</priority>\n";
    		echo "\t</url>\n";
    	}
    }
    eval($plxMotor->plxPlugins->callHook('SitemapCategories'));
    # Les articles
    if($aFiles = $plxMotor->plxGlob_arts->query('/^[0-9]{4}.[home|'.$plxMotor->activeCats.',]*.[0-9]{3}.[0-9]{12}.[a-z0-9-]+.xml$/','art','rsort', 0, false, 'before')) {
    	$plxRecord_arts = false;
    	$array=array();
    	foreach($aFiles as $k=>$v) { # On parcourt tous les fichiers
    		$array[ $k ] = $plxMotor->parseArticle(PLX_ROOT.$plxMotor->aConf['racine_articles'].$v);
    	}
    	# On stocke les enregistrements dans un objet plxRecord
    	$plxRecord_arts = new plxRecord($array);
    	if($plxRecord_arts) {
    		# On boucle sur nos articles
    		while($plxRecord_arts->loop()) {
    			$num = intval($plxRecord_arts->f('numero'));
    			echo "\n";
    			echo "\t<url>\n";
    			echo "\t\t<loc>".$plxMotor->urlRewrite("?article".$num."/".plxUtils::strCheck($plxRecord_arts->f('url')))."</loc>\n";
    			echo "\t\t<lastmod>".$plxRecord_arts->f('date')."</lastmod>\n";
    			echo "\t\t<changefreq>monthly</changefreq>\n";
    			echo "\t\t<priority>0.5</priority>\n";
    			echo "\t</url>\n";
    		}
    	}
    }
    eval($plxMotor->plxPlugins->callHook('SitemapArticles'));
    ?>
    </urlset>
    

    je mange mon chapeau là ...
    @+
  • StéphaneStéphane Member, Former PluXml Project Manager
    Prend le sitemap.php qui est ici

    http://websvn.pluxml.org/filedetails.php?repname=PluXml&path=%2Ftrunk%2Fsitemap.php

    Le format de date du sitemap.php est corrigé dans ce fichier qui est prévu pour la 5.1.7
    Désolé comme je travaille déjà pour la 5.1.7 j'avais oublié ce problème sur la 5.1.6

    Consultant PluXml

    Ancien responsable du projet (2010 à 2018)

  • Stéphane a écrit:
    Prend le sitemap.php qui est ici

    http://websvn.pluxml.org/filedetails.php?repname=PluXml&path=%2Ftrunk%2Fsitemap.php

    Le format de date du sitemap.php est corrigé dans ce fichier qui est prévu pour la 5.1.7
    Désolé comme je travaille déjà pour la 5.1.7 j'avais oublié ce problème sur la 5.1.6
    "404 no found ...
    The requested URL /unesourisetmoi.info/blog/install.php was not found on this server.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request."

    il y a qq chose à y modifier ?
  • StéphaneStéphane Member, Former PluXml Project Manager
    va sur le lien donnée plus haut et fait copier coller du code dans le fichier sitemap.php de ton site

    Consultant PluXml

    Ancien responsable du projet (2010 à 2018)

  • bg62bg62 Member
    juillet 2012 modifié
    Stéphane a écrit:
    va sur le lien donnée plus haut et fait copier coller du code dans le fichier sitemap.php de ton site
    c'est ce que j'ai fait (en local), je viens de refaire ... mêmes erreurs ... ;)
  • j'ai vu ici :
    http://forum.pluxml.org/viewtopic.php?id=3354
    ça ne me donne pas les heures ... minutes,
    mais j'ai au moins ceci :
    <lastmod>2007-08-31</lastmod><changefreq>monthly</changefreq><priority>0.5</priority>

    en modifiant le sitemap de 1.5.6 ... avec le 1.5.7 là je ne m'en sors pas ;)
    si tu as mieux ....
    @+
  • StéphaneStéphane Member, Former PluXml Project Manager
    La valeur des dates est définie sous le format validé pas la W3C, c'est à dire AAAA-MM-JJ
    Il n'y a pas à mettre les heures et les minutes (ce qui serait un non sens car ce ne serait plus une date)

    Consultant PluXml

    Ancien responsable du projet (2010 à 2018)

  • ok donc alors avec cette modif ... ça marche !
    super ;)
    et encore merci
    @mitiés
  • HarukaHaruka PluXml Project Manager
    Bonjour,


    Juste pour info, avec le sitemap de la 5.1.7 (merci Stéphane de nous le partager), j'ai moi aussi l'erreur 404 dans les webmaster tools. Je suis donc passé par la modification du sitemap de la 5.1.6.
Connectez-vous ou Inscrivez-vous pour répondre.