站长们应该都知道网站地图对于一个站点的重要性,网站设置百度sitemap.xml,能够帮助我们网站收录,让搜索引擎更加的了解你的网站(同时要注意对文件里权重的设置),下面就讲下在帝国cms里面怎么设置网站地图sitemap.xml。
首页打开帝国后台,栏目—自定义页面-增加自定义页面
选择:直接页面式 设置页面名称为sitemap.xml ,修改文件名为:../../sitemap.xml (根目录) 页面内容填写下面代码:
<?='<?xml version="1.0" encoding="UTF-8"?>'?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url> <loc>[!--news.url--]</loc> <lastmod> <?php echo date("Y-m-d"); ?></lastmod> <changefreq>daily</changefreq> <priority>1.000</priority> </url> [e:loop={"select * from [!db.pre!]enewsclass order by myorder",0,24,0}] <? if($bqr['classurl']=='') { $sccurl=$public_r['newsurl'].$bqr['classpath']."/"; } else { $sccurl=$bqr['classurl']."/"; } ?> <url> <loc><?=$sccurl?></loc> <changefreq>daily</changefreq> <priority>0.8000</priority> </url> [/e:loop] [e:loop={"select * from [!db.pre!]enewszt order by ztid",0,24,0}] <? if($bqr['zturl']=='') { $sccurl=$public_r['newsurl'].$bqr['ztpath']."/"; } else { $sccurl=$bqr['zturl']."/"; } ?> <url> <loc><?=$sccurl?></loc> <lastmod><?=date('Y-m-d',$bqr[newstime])?></lastmod> <changefreq>monthly</changefreq> <priority>0.6000</priority> </url> [/e:loop] [e:loop={"select * from [!db.pre!]ecms_news order by newstime desc",0,24,0}] <url> <loc><?=$bqsr[titleurl]?></loc> <lastmod><?=date('Y-m-d',$bqr[newstime])?></lastmod> <changefreq>monthly</changefreq> <priority>0.5000</priority> </url> [/e:loop] </urlset>
设置好后保存:刷新自定义页面
好了,帝国cms仿站之网站地图制作完成。
Hi, this is a comment. To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard. Commenter avatars come from Gravatar.