Home  >  Article  >  Backend Development  >  In centos, set the priority of indexhtml and indexphp

In centos, set the priority of indexhtml and indexphp

WBOY
WBOYOriginal
2016-08-08 09:19:031559browse

In centos, after installing apache and php, index.php has the highest priority by default.

If you want to change it to index.html, you need to edit the file as follows:

Edit the httpd.conf file, find the DirectoryIndex line, and add index.php As follows:

DirectoryIndex index.html index.htm index.php

Save the edited content (under vi, press esc and enter :wq Press Enter to save the edited text content and exit)

Modify the php related configuration file php.conf:

/etc/httpd/conf DirectoryIndex in the .d/php.conf file index.html index.htm index.php

The order of priority is index.html > index.htm > index.php

Finally restart Apache: service httpd restart

(If you encounter bash: service: command not found, it means there is a problem with the command path, just add /sbin/ in front of the command)


Copyright statement: This article is an original article by the blogger and has not been authorized Reprinting is not allowed with the permission of the blogger.

The above introduces the priority setting of indexhtml and indexphp in centos, including the content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
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