Home > CMS Tutorial > DEDECMS > How to modify the data directory name on the DEDECMS website

How to modify the data directory name on the DEDECMS website

藏色散人
Release: 2019-12-09 10:04:44
Original
2529 people have browsed it

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');
Copy after login

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');
Copy after login

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();
//}
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template