欢迎您光临自学哈网,只为分享网络知识教程,供大家学习参考!

「自学哈网」帝国CMS如何自动生成sitemap.xml网站地图(帝国cms模板)

作者 : 自学哈 本文共1997个字,预计阅读时间需要5分钟 2022-11-26 共149人阅读
也想出现在这里? 联系我们

步骤:

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,查看后满意即可。

本站声明:
本站所有资源来源于网络,分享目的仅供大家学习和交流!如若本站内容侵犯了原著者的合法权益,可联系邮箱976157886@qq.com进行删除。
自学哈专注于免费提供最新的分享知识、网络教程、网络技术的资源分享平台,好资源不私藏,大家一起分享!

自学哈网 » 「自学哈网」帝国CMS如何自动生成sitemap.xml网站地图(帝国cms模板)
也想出现在这里? 联系我们
© 2022 Theme by - 自学哈网 & WordPress Theme. All rights reserved 浙ICP备2022016594号