Dedecms网站地图目录修改方法

很多用DEDECMS做站的朋友,为避免将data目录内的东西随便外泄,在robots中将data目录屏蔽了,但是DEDE默认的网站地图 却是在 data下,屏蔽掉这个文件夹的话搜索引擎就无法抓取到网站地图,这不利于SEO优化。

下面是让DEDE生成的网站地图放在系统根目录的修改方法及详细步骤:

1、首先在网站根目录下建立rss文件夹

2、修改/dede/makehtml_map.php文件

$cfg_cmspath."/data/sitemap.html";

修改为:

$cfg_cmspath."/sitemap.html";

$cfg_cmspath."/data/rssmap.html";

修改为:

$cfg_cmspath."/rssmap.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";

此时再到网站后台生成网站地图的时候,就会直接生成到网站根目录了。

📮邮件订阅
非常感谢您的关注和支持!欢迎订阅我的博客!
top
commit