How to set the default homepage in Apache

  • 2020-05-07 20:48:30
  • OfStack

After you install the Apache directory, there is one conf directory, in this directory, there is one "httpd.conf" file.

In this file, every line beginning with "#" is invalid. If you want your Settings to work, you should remove the "#" at the beginning of the line.

Go to DirectoryIndex and change it to DirectoryIndex index.php index.Html index.html so that the default home page of your website directory is index.php, and if you don't have index.php, index.html and html will be automatically found as the default home page.

Note: index.php. index.Html

In addition, you can also operate 1 other:

Go to ServerRoot. Set it to your Apache installation directory. Mine is ServerRoot "D:/Apache Group/Apache2".

Go to DocumentRoot. Make it the root of your site. Mine is DocumentRoot "D:/Apache Group/web

Related articles: