Many use Dedecms to do station friends, in order to avoid the contents of the data in a random leak, in the robots will be the data directory shielding, but Dede default site map is in the data, shielding this folder words search engine can not crawl to the site map, which is not conducive to SEO optimization , then there is no good way, let Dede generated site map under the system root directory? Below I will introduce you to Dede site Map optimization method.
The following are detailed steps:
1, first in the site root directory to create an RSS folder
2. Modify/dede/makehtml_map.php File
Will
The code is as follows |
Copy Code |
$cfg _cmspath. " /data/sitemap.html "; |
Modified to:
The code is as follows |
Copy Code |
$cfg _cmspath. " /sitemap.html "; |
Will
The code is as follows |
Copy Code |
$cfg _cmspath. " /data/rssmap.html "; |
Modified to:
The code is as follows |
Copy Code |
$cfg _cmspath. " /rssmap.html "; |
3, modify the/include/arc.rssview.class.php file will
The code is as follows |
Copy Code |
$murl = $GLOBALS [' Cfg_cmspath ']. " /data/rss/". $this->typeid.". XML "; |
Modified to:
The code is as follows |
Copy Code |
$murl = $GLOBALS [' Cfg_cmspath ']. " /rss/". $this->typeid.". XML "; |
4. Modify/include/sitemap.class.php File
The following content
The code is as follows |
Copy Code |
$typelink = $GLOBALS [' Cfg_cmsurl ']. " /data/rss/". $row->id.". XML "; |
Modified to:
The code is as follows |
Copy Code |
$typelink = $GLOBALS [' Cfg_cmsurl ']. " /rss/". $row->id.". XML "; |
At this point and then to the site background to generate site map, it will be directly generated to the root directory of the site.