站長們應該都知道網站地圖對於一個站點的重要性,網站設置百度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仿站之網站地圖制作完成。