Web Hosting Forum - Explore the Latest in Web Hosting Discussions

We are a community of individuals and businesses passionate about web hosting. Let's build, learn, and grow together.

How to fix when apache prioritize HTML files over PHP files

BertLebr

Novice
Member
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
  • 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
  • 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

    Back
    Top