In centos, set the priority of indexhtml and indexphp

WBOY
Release: 2016-08-08 09:19:03
Original
1524 people have browsed it

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.

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!