为避免将data目录内的东西随便外泄,在robots中将data目录屏蔽了,但是DEDE默认的网站地图 却是在 data下,屏蔽掉这个文件夹的话搜索引擎就无法抓取到网站地图.
下面是详细的步骤:
1、首先在网站根目录下建立rss文件夹
2、修改/dede/makehtml_map.php文件
将:$cfg_cmspath."/data/sitemap.html";
修改为:$cfg_cmspath."/sitemap.html";
3、修改/include/arc.rssview.class.php文件
将:$murl = $GLOBALS['cfg_cmspath']."/data/rss/".$this->TypeID.".xml";
修改为:$murl = $GLOBALS['cfg_cmspath']."/rss/".$this->TypeID.".xml";
4、修改/include/sitemap.class.php文件
将以下内容:
$typelink = $GLOBALS['cfg_cmsurl']."/data/rss/".$row->id.".xml";
修改为:$typelink = $GLOBALS['cfg_cmsurl']."/rss/".$row->id.".xml";
此时再到网站后台生成网站地图的时候,就会直接生成到网站根目录了.