| 
	织梦dedecms制作网站地图。sitemap是网站上各网页的列表。创建并提交sitemap有助于百度(Google)发现并了解您网站上的所有网页,包括百度通过传统抓取方式可能找不到的网页。还可以使用sitemap提供有关你网站的其他信息,如上次更新日期、sitemap文件的更新频率等,供百度 (Google)spider参考。 一.织梦DEDECMS sitemap.html的制作
 
	这里我们用织梦自带的标签生成
 
	 
	但是生成的路径是在/data目录下,我们一般放在根目录下,所以更改一下文件: 
	  方法如下: 第一步:打开/dede/makehtml_map.php
 
	
		  if($dopost=="site")
		  {
		  $murl = $cfg_cmspath."/data/sitemap.html"; //内容来自织梦模板团
		  $tmpfile = $cfg_basedir.$cfg_templets_dir."/plus/sitemap.htm";
		  }
		  更改成为
		  if($dopost=="site")
		  {
		  $murl = $cfg_cmspath."/sitemap.html";
		  $tmpfile = $cfg_basedir.$cfg_templets_dir."/plus/sitemap.htm";
		  } 
	这样就实现了sitemap.html放在根目录的的任务了二.织梦DEDECMS sitemap.xml的制作 
 
	
		<?xml version="1.0" encoding="UTF-8"?>
		<urlset xmlns="http://www.google.com/schemas/sitemap/0.84">
		<url>
		<loc>{dede:global.cfg_basehost/}</loc>
		<lastmod>{dede:arclist row=1 titlelen=24 orderby=pubdate}
		[field:pubdate function=strftime('%Y-%m-%d',@me)/]
		{/dede:arclist}</lastmod>
		<changefreq>always</changefreq>
		<priority>1.0</priority>
		</url>
		{dede:channel row='1000' type='top'}
		<url>
		<loc>[field:typelink /]</loc>
		<changefreq>daily</changefreq>
		<priority>0.9</priority>
		</url>
		{/dede:channel}
		{dede:arclist row=2000 orderby=pubdate}
		<url>
		<loc>[field:arcurl/]</loc>
		<lastmod>[field:pubdate function=strftime('%Y-%m-%d',@me)/]</lastmod>
		<changefreq>monthly</changefreq>
		<priority>0.8</priority>
		</url>
		{/dede:arclist}
		</urlset> 
	将上面这个文件保存成一个模板文件如gsitemap.htm,放在模板目录下如templets/plus下 
	然后织梦后台操作 
	
  
	里增加一个列表 
	
  
	按上图设置,注意的是,“不限”那里先随便选择,保存后再修改成“不限”,然后“更新”,生成文件。 
	      这里有两个问题: 1.生成栏目和文章链接如/npx ,/a/npx/2014/0829/447.html等,没有域名,这个问题从后台=》核心设置=》再如下图开启支持多站点
 
	
  
	至此织梦中html和xml格式的网站地图就生成了。(责任编辑:最模板) |