1.首先制作模板。在你的模板下(例如templets\default)新建一个sitemap.xml的空文件。在里面写入如下代码
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.google.com/schemas/sitemap/0.84"> <url> <loc>http://www.apieye.com/</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=10 type='top'} <url> <loc>http://www.apieye.com[field:typelink /]</loc> <changefreq>daily</changefreq> <priority>0.8</priority> </url> {/dede:channel} {dede:arclist row=5000 orderby=pubdate} <url> <loc>http://www.apieye.com[field:arcurl/]</loc> <lastmod>[field:pubdate function=strftime('%Y-%m-%d',@me)/]</lastmod> <changefreq>monthly</changefreq> </url> {/dede:arclist} </urlset> |
其中channel下的row代表你有多少个栏目,arclist下的row代表你有多少篇文章,www.apieye.com换成你的域名
2.在dede后台功能地图里找到单独页面管理然后增加新页面,照下图所示进行操作
保存后就可以在根目录下找到生成好的sitemap.xml了。
声明: 本文由( 炫酷网站设计建设 )原创编译,转载请保留链接: DedeCMS添加sitemap.xml