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!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function