一、新建一個sitemap.htm模板
-
登錄dedecms后臺,選擇【模板】-【模板管理】-【默認模板管理】
-
<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><url><loc>http://www.edietgr.com/</loc><lastmod>{dede:arclist row=1 titlelen=24 orderby=pubdate}[field:pubdate function=strftime('%Y-%m-%d',@me)/]{/dede:arclist}</lastmod><changefreq>always</changefreq><priority>1.0</priority></url>{dede:channel row='200' type='top'}<url><loc>http://www.edietgr.com[field:typelink /]</loc><changefreq>always</changefreq><priority>0.8</priority></url>{/dede:channel}{dede:channel type='son' typeid='1'}<url><loc>http://www.edietgr.com[field:typelink /]</loc><changefreq>daily</changefreq><priority>0.7</priority></url>{/dede:channel}{dede:arclist row='5000' orderby=pubdate}<url><loc>http://www.edietgr.com[field:arcurl/]</loc><lastmod>[field:pubdate function=strftime('%Y-%m-%d',@me)/]</lastmod><changefreq>always</changefreq><priority>0.6</priority></url>{/dede:arclist}</urlset>說明:這個是url調用代碼,請直接將每個代碼的域名(http://www.edietgr.com)改成自己的即可,第一個代碼塊為首頁,第二個為欄目頁,第三個為二級欄目頁,第四個為內容頁,row表示url條數,type='top'表示一級欄目,type='son' 表示二級欄目,typeid='1'表示一級欄目id。
-
將改模板命名為:sitemap.htm,PS:請記得將代碼中的域名改為自己的域名,然后保存!如下圖
END
二、新建一個單頁文檔管理
-
dedecms后臺選擇【核心】-【頻道模型】-【單頁文檔管理】,如下圖:
-
-
對照上圖并填入相對于的信息:
頁面標題:sitemap
關聯標識: default
模板文件名:{style}/sitemap.htm
文件名: sitemap.xml
三、生成sitemap.xml地圖
-
【核心】-【頻道模型】-【單頁文檔管理】-【更新所有頁面】即可,更新之后訪問http://您的域名/sitemap.xml查看地圖
-