帝国CMS系统自动生成sitemap.xml网站地图的教程

1.登录网站的后台http://你的域名/e/admin/,原理使用帝国cms的自定义页面功能。

2.进入后台栏目 =》增加自定义页面 =》选择直接页面,页面名称为:网站地图,文件名修改为 …/…/sitemap.xml

sitemap.xml

内容填写如下:(注意将示例中:http://www.XXXX.com修改为自己的域名

<?='<?xml version="1.0" encoding="UTF-8"?>'?>
   <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    <url>
        <loc>[!--news.url--]</loc>
        <changefreq>daily</changefreq>
        <priority>1.0</priority>
    </url>
    <url>
        <loc>[!--news.url--]hmoban</loc>
        <changefreq>daily</changefreq>
        <priority>0.8</priority>
    </url>
    <url>
        <loc>[!--news.url--]wpyuanma</loc>
        <changefreq>daily</changefreq>
        <priority>0.8</priority>
    </url>
    <url>
        <loc>[!--news.url--]diguoCMS</loc>
        <changefreq>daily</changefreq>
        <priority>0.8</priority>
    </url>
    <url>
        <loc>[!--news.url--]news</loc>
        <changefreq>daily</changefreq>
        <priority>0.8</priority>
    </url>

    
    
    [e:loop={1,30000,3,1,'','newstime DESC'}]
    <url>
        <loc>http://www.XXXX.com<?=$bqsr['titleurl']?></loc>
        <lastmod><?=date('Y-m-d',$bqr[newstime])?></lastmod>
        <changefreq>monthly</changefreq>
        <priority>0.7</priority>
    </url>
    [/e:loop]

[e:loop={2,30000,3,1,'','newstime DESC'}]
    <url>
        <loc>http://www.XXXX.com<?=$bqsr['titleurl']?></loc>
        <lastmod><?=date('Y-m-d',$bqr[newstime])?></lastmod>
        <changefreq>monthly</changefreq>
        <priority>0.7</priority>
    </url>
    [/e:loop]

[e:loop={3,30000,3,1,'','newstime DESC'}]
    <url>
        <loc>http://www.XXXX.com<?=$bqsr['titleurl']?></loc>
        <lastmod><?=date('Y-m-d',$bqr[newstime])?></lastmod>
        <changefreq>monthly</changefreq>
        <priority>0.7</priority>
    </url>
    [/e:loop]

[e:loop={4,30000,3,1,'','newstime DESC'}]
    <url>
        <loc>http://www.XXXX.com<?=$bqsr['titleurl']?></loc>
        <lastmod><?=date('Y-m-d',$bqr[newstime])?></lastmod>
        <changefreq>monthly</changefreq>
        <priority>0.7</priority>
    </url>
    [/e:loop]


</urlset>

这里面注意一下:[e:loop={栏目ID,30000,3,1,’’,‘newstime DESC’}]

栏目ID你要根据自己的网站继续列出来,这里举例只有4个栏目


下面是设置自动刷新自定义页面的方法

看图:
sitemap.xml

设置方法:系统 =》计划任务 =》 管理计划任务 =》 刷新自定页面 =》

算好时间就好了。

猜你喜欢

转载自blog.csdn.net/fyd2333/article/details/82699690