Forum - GuppY 6 - Sitemaps en xml
Bonjour,
il me semble qu'il y a une erreur lors de la génération de sitemaps.xml. la balise donne lien pour les fichiers articles, faq .. en .xml
Le lien vers le fichier est amputé de 3 caractères ce qui génèrent par exemple
<sitemap> <loc>https://www.nomdedomaine.info/rt.xml</loc> <lastmod>2021-01-26</lastmod> </sitemap> <sitemap> <loc>https://www.nomdedomaine.info/ews.xml</loc> <lastmod>2021-01-26</lastmod> </sitemap> <sitemap> <loc>https://www.nomdedomaine.info/hoto.xml</loc> <lastmod>2021-01-26</lastmod> </sitemap>
Provoquant une erreur 403
la partie qui génère est functions.php
if (file_exists(SM_URLS)) $dbws[] = array('LOC'=>substr(SM_URLS, 3), 'LM'=>date('Y-m-d', filemtime(SM_URLS))); if (file_exists(SM_BLOG)) $dbws[] = array('LOC'=>substr(SM_BLOG, 3), 'LM'=>date('Y-m-d', filemtime(SM_BLOG))); if (file_exists(SM_ART)) $dbws[] = array('LOC'=>substr(SM_ART, 3), 'LM'=>date('Y-m-d', filemtime(SM_ART))); if (file_exists(SM_NEWS)) $dbws[] = array('LOC'=>substr(SM_NEWS, 3), 'LM'=>date('Y-m-d', filemtime(SM_NEWS))); if (file_exists(SM_PHOTO)) $dbws[] = array('LOC'=>substr(SM_PHOTO, 3), 'LM'=>date('Y-m-d', filemtime(SM_PHOTO))); if (file_exists(SM_DNLOAD)) $dbws[] = array('LOC'=>substr(SM_DNLOAD, 3), 'LM'=>date('Y-m-d', filemtime(SM_DNLOAD))); if (file_exists(SM_FAQ)) $dbws[] = array('LOC'=>substr(SM_FAQ, 3), 'LM'=>date('Y-m-d', filemtime(SM_FAQ))); if (file_exists(SM_LINKS)) $dbws[] = array('LOC'=>substr(SM_LINKS, 3), 'LM'=>date('Y-m-d', filemtime(SM_LINKS))); if (file_exists(SM_GUESTBK)) $dbws[] = array('LOC'=>substr(SM_GUESTBK, 3), 'LM'=>date('Y-m-d', filemtime(SM_GUESTBK))); if (file_exists(SM_FORUM)) $dbws[] = array('LOC'=>substr(SM_FORUM, 3), 'LM'=>date('Y-m-d', filemtime(SM_FORUM))); if (file_exists(SM_AGENDA)) $dbws[] = array('LOC'=>substr(SM_AGENDA, 3), 'LM'=>date('Y-m-d', filemtime(SM_AGENDA)));
Bonne journée
Bonjour,
J'utilise sur mes sites la génération des sitemaps et je ne constate pas ce problème.
Les noms des fichiers xml à générer sont dans des constantes stockées dans le fichier constantes.php, vérifie donc si cela est conforme aux définitions ci-dessous :
define('SITEMAPS', CHEMIN.'sitemaps.xml'); define('SM_BLOG', CHEMIN.'smblog.xml'); define('SM_ART', CHEMIN.'smart.xml'); define('SM_NEWS', CHEMIN.'smnews.xml'); define('SM_PHOTO', CHEMIN.'smphoto.xml'); define('SM_DNLOAD', CHEMIN.'smdnload.xml'); define('SM_FAQ', CHEMIN.'smfaq.xml'); define('SM_LINKS', CHEMIN.'smlinks.xml'); define('SM_GUESTBK', CHEMIN.'smguestbk.xml'); define('SM_FORUM', CHEMIN.'smforum.xml'); define('SM_AGENDA', CHEMIN.'smagenda.xml'); define('SM_URLS', CHEMIN.'smurls.xml');
Amicalement, Saxbar.
Bonjour,
je redonne le contenu du fichier sitemaps.xml
<?xml version="1.0" encoding="UTF-8"?> <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <sitemap> <loc>https://www.nomdedomaine.info/rls.xml</loc> <lastmod>2021-02-05</lastmod> </sitemap> <sitemap> <loc>https://www.nomdedomaine.info/log.xml</loc> <lastmod>2021-01-26</lastmod> </sitemap> <sitemap> <loc>https://www.nomdedomaine.info/rt.xml</loc> <lastmod>2021-01-26</lastmod> </sitemap> <sitemap> <loc>https://www.nomdedomaine.info/ews.xml</loc> <lastmod>2021-01-26</lastmod> </sitemap> <sitemap> <loc>https://www.nomdedomaine.info/hoto.xml</loc> <lastmod>2021-01-26</lastmod> </sitemap> <sitemap> <loc>https://www.nomdedomaine.info/nload.xml</loc> <lastmod>2021-02-02</lastmod> </sitemap> <sitemap> <loc>https://www.nomdedomaine.info/aq.xml</loc> <lastmod>2021-01-26</lastmod> </sitemap> <sitemap> <loc>https://www.nomdedomaine.info/inks.xml</loc> <lastmod>2021-01-26</lastmod> </sitemap> <sitemap> <loc>https://www.nomdedomaine.info/uestbk.xml</loc> <lastmod>2021-01-30</lastmod> </sitemap> <sitemap> <loc>https://www.nomdedomaine.info/orum.xml</loc> <lastmod>2021-02-05</lastmod> </sitemap> <sitemap> <loc>https://www.nomdedomaine.info/genda.xml</loc> <lastmod>2021-01-26</lastmod> </sitemap> </sitemapindex>
le nomdedomaine remplace le vrai nom de domaine
Je précise que je n'ai pas personnalisé ni modifié
A+
Bonjour,
Je viens d'apporter une modif car je ne me souvenais plus que la mise à jour des sitemaps se faisait en admin et à la racine, donc pas avec le même chemin, donc la valeur 3 utilisée n'est pas correcte.
Pour que tu puisses vérifier sans attendre le prochain patch, voici la modif :
$len = strlen(CHEMIN); if (file_exists(SM_URLS)) $dbws[] = array('LOC'=>substr(SM_URLS, $len), 'LM'=>date('Y-m-d', filemtime(SM_URLS))); if (file_exists(SM_BLOG)) $dbws[] = array('LOC'=>substr(SM_BLOG, $len), 'LM'=>date('Y-m-d', filemtime(SM_BLOG))); if (file_exists(SM_ART)) $dbws[] = array('LOC'=>substr(SM_ART, $len), 'LM'=>date('Y-m-d', filemtime(SM_ART))); if (file_exists(SM_NEWS)) $dbws[] = array('LOC'=>substr(SM_NEWS, $len), 'LM'=>date('Y-m-d', filemtime(SM_NEWS))); if (file_exists(SM_PHOTO)) $dbws[] = array('LOC'=>substr(SM_PHOTO, $len), 'LM'=>date('Y-m-d', filemtime(SM_PHOTO))); if (file_exists(SM_DNLOAD)) $dbws[] = array('LOC'=>substr(SM_DNLOAD, $len), 'LM'=>date('Y-m-d', filemtime(SM_DNLOAD))); if (file_exists(SM_FAQ)) $dbws[] = array('LOC'=>substr(SM_FAQ, $len), 'LM'=>date('Y-m-d', filemtime(SM_FAQ))); if (file_exists(SM_LINKS)) $dbws[] = array('LOC'=>substr(SM_LINKS, $len), 'LM'=>date('Y-m-d', filemtime(SM_LINKS))); if (file_exists(SM_GUESTBK)) $dbws[] = array('LOC'=>substr(SM_GUESTBK, $len), 'LM'=>date('Y-m-d', filemtime(SM_GUESTBK))); if (file_exists(SM_FORUM)) $dbws[] = array('LOC'=>substr(SM_FORUM, $len), 'LM'=>date('Y-m-d', filemtime(SM_FORUM))); if (file_exists(SM_AGENDA)) $dbws[] = array('LOC'=>substr(SM_AGENDA, $len), 'LM'=>date('Y-m-d', filemtime(SM_AGENDA)));
Amicalement, Saxbar.