Home > Article > CMS Tutorial > How to modify the data directory name on the DEDECMS website
How to change the name of the data directory on the DEDECMS website?
Recently, dedecms vulnerabilities have appeared frequently, and Dreamweaver officials have also provided many corresponding measures. What I will tell you today is that dedecms officially recommends users to modify the data file name. For virtual hosts, some virtual hosts have restrictions and do not allow moving outside the web directory. In order to minimize the possibility of the website being attacked, we can rename the data directory, which further reduces the possibility of attacks.
Recommended learning: Dream Weaver cms
1. Modify the common.inc.php file in the include directory. Open the file and find line 16:
The code is as follows:
define('DEDEDATA', DEDEROOT.'/data');
Change data to the directory name you want to change, for example: to 22badata, then change it to:
The code is as follows:
define('DEDEDATA', DEDEROOT.'/22badata');
2. Use FTP to rename the data directory to 22badata, which is the same as the file name changed in the first step.
3. In the website background, go to System-Basic System Parameters-Performance Options, and change "Template Cache Directory:" to: /22badata/tplcache.
The change is basically completed, but there are still some problems. Open the website directory and you will find that you have jumped to the installation file. Don't worry, modify the index.php file in the root directory of the website, comment out the first few lines of the file, comment as follows, that is, add // in front of the code, the code is as follows:
The code is as follows:
//if(!file_exists(dirname(__FILE__).'/data/common.inc.php')) //{ // header('Location:install/index.php'); // exit(); //}
In this way, your website can be opened normally. When updating in the background, there are still problems. There are problems with the website map and RSS and JS updates. Then we only need to create a new data directory under the website root directory, and then create two new rss and js directories under the data directory. , that’s it, update it again and see if everything is normal?
Note: The change directory mentioned above is 22badata, where 22badata can be freely replaced with the directory name you want.
The above is the detailed content of How to modify the data directory name on the DEDECMS website. For more information, please follow other related articles on the PHP Chinese website!