How to fix when apache prioritize HTML files over PHP files

Welcome to our community

Be apart of something great, join today!

BertLebr

Newbie
Messages
10
Reaction score
0
Points
1
Hi all,

How I can set apache DirectoryIndex which specifies the default files to look for when the user/browser doesn't request a specific file. I want the PHP file to load when people go to the URL without needing to have /specific.php & I notice that apache prioritizes HTML files over PHP files.

Thanks
 
  • Advertisement
  • radix24

    Newbie
    Messages
    11
    Reaction score
    1
    Points
    3
    You can set the default directory index page using a .htaccess file. To enable the DirectoryIndex directive in the .htaccess file replace the filename with the file that you want to display whenever a user requests to your website.
    You don't have permission to view the spoiler content. Log in or register now.

    You can also specify multiple filenames, and the webserver will search for each file until it finds a match.
    You don't have permission to view the spoiler content. Log in or register now.

    Usually, people have HTML files first because HTML files don't require any overhead, while PHP files require the PHP engine to load up and process that .php file. That's why usually the less-heavy files are preferred.

    Hope this help
     
  • Advertisement
  • BertLebr

    Newbie
    Messages
    10
    Reaction score
    0
    Points
    1
    You can set the default directory index page using a .htaccess file. To enable the DirectoryIndex directive in the .htaccess file replace the filename with the file that you want to display whenever a user requests to your website.
    You don't have permission to view the spoiler content. Log in or register now.

    You can also specify multiple filenames, and the webserver will search for each file until it finds a match.
    You don't have permission to view the spoiler content. Log in or register now.

    Usually, people have HTML files first because HTML files don't require any overhead, while PHP files require the PHP engine to load up and process that .php file. That's why usually the less-heavy files are preferred.

    Hope this help
    Thank you @radix24 & yes, it really helps me :)
     

    Advertisement

    Top