Hi,
I have a page I want to load INSTEAD of index.php. I for the moment called it index.html.. How can I set Apache to load the html instead of the php. I cannot rename the php file. I can rename the html file.
Thanks for any guidance
How to load index.html and not index.php
Re: How to load index.html and not index.php
Can use just use the DirectoryIndex directive?
1) Make sure directory module is loaded by httpd (I think it's called mod_dir).
2) Then list the preferences in the DirectoryIndex as in DirectoryIndex index.html index.php index.phtml index.htm
Look here for more info (http://httpd.apache.org/docs/2.2/mod/mod_dir.html)
1) Make sure directory module is loaded by httpd (I think it's called mod_dir).
2) Then list the preferences in the DirectoryIndex as in DirectoryIndex index.html index.php index.phtml index.htm
Look here for more info (http://httpd.apache.org/docs/2.2/mod/mod_dir.html)
Re: How to load index.html and not index.php
Hi
Thanks for the reply. I found the Directoryindex info after I posted. index.html is in there as the first entry. mod_dir is loaded according to the httpd.conf file Any other ideas??
Thanks
Thanks for the reply. I found the Directoryindex info after I posted. index.html is in there as the first entry. mod_dir is loaded according to the httpd.conf file Any other ideas??
Thanks
Re: How to load index.html and not index.php
So you've loaded the module and created the directive - but you can not get the result?
Perhaps post the contents of the file that has the directive.
Perhaps post the contents of the file that has the directive.
Re: How to load index.html and not index.php
Here is the entry for DirectoryIndex
Here is where the module is loaded
When I restart httpd I do not get any errors.
Code: Select all
#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
# The index.html.var file (a type-map) is used to deliver content-
# negotiated documents. The MultiViews Option can be used for the
# same purpose, but it is much slower.
#
#DirectoryIndex index.html index.html.var
DirectoryIndex index.html
#
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives. See also the AllowOverride
# directive.
#
Code: Select all
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule dir_module modules/mod_dir.so
LoadModule actions_module modules/mod_actions.so
Re: How to load index.html and not index.php
I'd suspect that you have more than one DirectoryIndex present in your config files. Run grep -ir directoryindex /etc/httpd/* to find them all.
CentOS 6 died in November 2020 - migrate to a new version!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke
Re: How to load index.html and not index.php
Nailed it!
There was a php.conf file in /etc/httpd/conf.d that had the directiveindex for index.php After I added index.html before it appears to work the way I want it.
Thanks !!
There was a php.conf file in /etc/httpd/conf.d that had the directiveindex for index.php After I added index.html before it appears to work the way I want it.
Thanks !!