发现自己的一个站点在百度站长平台上提示sitemap存在无效url,看完提示后发现,地图文件当中没有显示全网址,因此找到templets/plus/sitemap.xml文件,在下面代码当中找到两处loc标签当中加上域名,地图当中就会显示整个url。例如域名是www.baidu.com,修改为:<loc>http://www.baidu.com[field:typelink /]</loc>即可。
<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url> <loc>{dede:global.cfg_basehost/}</loc> <lastmod>{dede:arclist row=1 titlelen=24 orderby=pubdate} [field:pubdate function=strftime('%Y-%m-%d',@me)/] {/dede:arclist}</lastmod> <changefreq>daily</changefreq> <priority>1.0</priority> </url> {dede:channel row='6' type='top'} <url> <loc>[field:typelink /]</loc> <changefreq>daily</changefreq> <priority>0.8</priority> </url> {/dede:channel} {dede:arclist row=1000 orderby=pubdate} <url> <loc>[field:arcurl/]</loc> <lastmod>[field:pubdate function=strftime('%Y-%m-%d',@me)/]</lastmod> <changefreq>monthly</changefreq> </url> {/dede:arclist} </urlset>