欢迎来到资源库(www.zyku.net)

帝国CMS

当前位置:首页 > CMS教程 > 帝国CMS > 帝国CMS网站地图

帝国CMS如何自动生成sitemap.xml网站地图

时间:2021-06-30|栏目:帝国CMS|点击:|我要投稿

步骤:

1、登录网站的后台http://你的域名/e/admin/  进入后台栏目 =》增加自定义页面 =》选择直接页面,页面名称为:网站地图,文件名修改为  ../../sitemap.xml

2、具体sitemap.xml模板代码,标准如下:

<?='<?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><?=$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><?=$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><?=$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><?=$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,可以修改成后台所有ID,不够就直接增加。

3、设置自动更新功能,手动刷新生成自页面。

4、全部完成后,请打开http://你的域名/sitemap.xml,查看后满意即可。  

(资源库 www.zyku.net)

原文链接:http://www.wangshifan.com/post/134.html

上一篇:帝国CMS在PHP文件中调用数据库类执行SQL语句实例

栏    目:帝国CMS

下一篇:帝国CMS内容页文章字数统计

本文标题:帝国CMS如何自动生成sitemap.xml网站地图

本文地址:https://www.zyku.net/ecms/2269.html

关于我们 | 版权申明 | 寻求合作 |

重要申明:本站所有的文章、图片、评论等内容,均由网友发表或上传并维护或收集自网络,仅供个人学习交流使用,版权归原作者所有。

如有侵犯您的版权,请与我们联系,我们将在24小时内进行处理、任何非本站因素导致的法律后果,本站均不负任何责任。

联系QQ:95148658 | 邮箱:mb8#qq.com(#换成@)

苏ICP备2020066115号-1

本网站由提供CDN加速/云存储服务