修改dede织梦sitemap路径的方法



在织梦DedeCMS网站中一般都会有地图,网站地图对网站的优化来说是非常重要的,织梦地图默认的存放地址是/data/sitemap.html,我们也都知道data目录是要禁止的,所以sitemap的路径必须要修改,这样才能不会影响到网站的优化。


打开/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”;