Home > Article > Backend Development > Apache: Set the order in which the homepage runs indexhtml indexphp
Reposted from: http://blog.sina.com.cn/s/blog_a345dd4c01011wug.html
Edit the httpd.conf file, find DirectoryIndex and add an index.php at the end.
For example, I changed the DirectoryIndex line to: DirectoryIndex index.html index.htm index.php index.html.var
Save the edited content and restart Apache to achieve it.
DirectoryIndex index.html index.htm index.php index.php3
If you still cannot run the homepage in order after the above settings, you must modify the php related configuration file php. conf
The
DirectoryIndex index.php
in the /etc/httpd/conf.d/php.conf file is even index.php first. If DirectoryIndex index.php is removed, index.html should also be changed to DirectoryIndex index.html or DirectoryIndex index.html index.php
The above introduces Apache: setting the order of running indexhtml indexphp on the homepage, including Apache content. I hope it will be helpful to friends who are interested in PHP tutorials.