Welcome to Web Hosting Forum - Net Hosting Talk

Register now and be part of our community! When you register with the Net Hosting Talk you can join in with topics, start new topics, and generally be a part of the first level of our community. It's also quick and totally free, so what are you waiting for?

How to fix when apache prioritize HTML files over PHP files

BertLebr

Newbie
Messages
9
Reaction score
0
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
 

radix24

Newbie
Messages
9
Reaction score
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
 

BertLebr

Newbie
Messages
9
Reaction score
0
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