A problem with the order of execution of files index.html and index.php

General support questions
Post Reply
litterec
Posts: 2
Joined: 2021/12/24 14:49:23

A problem with the order of execution of files index.html and index.php

Post by litterec » 2021/12/24 15:25:07

Hello!

I have two files in the root of the site:
index.html and index.php

I would like the index.html file to be interpreted when the site is visited.

I have such directive in site description file

Code: Select all

DirectoryIndex index.html index.htm index.php
Unfortunately, the index.html file is not interpreted. The file index.php is interpreted instead.

If I put the similar DirectoryIndex directive in the .htaccess file, then everything works fine. That is, in this case, the index.htm file is interpreted properly.

I enclose two files in the attachment:

- The file .htaccess in the root folder of the site
- Site descriptor in folder /etc/httpd/sites-available

Please help me with this issue.
Thank you beforehand!
Attachments
htaccess.txt
The file .htaccess in the root folder of the site
(1.3 KiB) Downloaded 21 times
altair.ra-solo.com.ua.txt
Site descriptor in folder /etc/httpd/sites-available
(949 Bytes) Downloaded 21 times

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: A problem with the order of execution of files index.html and index.php

Post by TrevorH » 2021/12/24 16:26:18

Moved from the Website section as that's for problems with the *CentOS* website, not with yours. Now in the CentSO 7 section, if not the correct one the please let us know and we'll move it again.

I'd guess you have multiple DirectoryIndex lines in your config and it's picking the wrong one in preference to the one you've added.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

litterec
Posts: 2
Joined: 2021/12/24 14:49:23

Re: A problem with the order of execution of files index.html and index.php

Post by litterec » 2021/12/26 13:19:13

TrevorH wrote:
2021/12/24 16:26:18
I'd guess you have multiple DirectoryIndex lines in your config and it's picking the wrong one in preference to the one you've added.
Thank you cincerely for your great help!

Such DirectoryIndex line was in the php.conf file.

Post Reply