好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

帝国cms网站地图sitemap.xml的制作方法

站长们应该都知道网站地图对于一个站点的重要性,网站设置百度sitemap.xml,能够帮助我们网站收录,让搜索引擎更加的了解你的网站(同时要注意对文件里权重的设置),下面就讲下在帝国cms里面怎么设置网站地图sitemap.xml。

首页打开帝国后台,栏目—自定义页面-增加自定义页面

选择:直接页面式 设置页面名称为sitemap.xml ,修改文件名为:sitemap.xml (根目录) 页面内容填写下面代码:

?

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

<?='<? 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仿站之网站地图制作完成。

查看更多关于帝国cms网站地图sitemap.xml的制作方法的详细内容...

  阅读:53次