本節內容:
織夢(dedecms)網站地圖改變生成目錄
使用DEDECMS做站是,為避免將data目錄內的東西隨便外泄,在robots中將data目錄屏蔽了,但是DEDE默認的網站地圖在 data下,屏蔽掉此文件夾時,搜索引擎就無法抓取到網站地圖。
本節介紹下,讓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";
此時再到網站后臺生成網站地圖時,則會直接生成到網站根目錄下了。