The Apache website root directory in the XAMPP collection software is by default under the XAMPP subfolder htdocs, when you build a lot of websites, some are large , it is a bit inconvenient to quickly open this directory on your computer. Below, I will briefly explain how to modify the website root directory: (Recommended learning: apache use)
First, open the httpd.conf file. This file is in the "apache\conf" folder under the XAMPP installation directory. (My own httpd.conf file directory is: D:\xampp\apache\conf)
Second, modify the code. In the httpd.conf file, find the following two lines of code and modify them. (The original root directory of my website is: D:\xampp\htdocs)
DocumentRoot "D:/xampp/htdocs" <Directory "D:/xampp/htdocs">
Just change the two directories to the directories you want. For example, I modified it as follows: (D:/WEB is my current directory New URL root directory)
DocumentRoot "E:/WEB" <Directory "E:/WEB">
Third, restart Apache. Copy the website files to the new website directory, restart Apache, OK
The above is the detailed content of What is the root directory of apache. For more information, please follow other related articles on the PHP Chinese website!