简体   繁体   中英

apache server serving index.html instead of index.php, after changing the file preference inside the dir.conf file

I changed the file preference inside the dir.conf file:

$sudo nano /etc/apache2/mods-enabled/dir.conf

<IfModule mod_dir.c>
    DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm
</IfModule>

This means that index.php will get first preference, right?

In /var/www/html i have two files ie index.html and index.php. But when i visit my ip_address in my browser, the index.html is being served instead of index.php. Am i missing out something?

Change your dir.conf file :

<IfModule mod_dir.c>
        DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm
</IfModule>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM