John Grosshans
asked on
Have web server load index.html instead of index.php as default
I have a webserver set up using CentOS and Apache
I need the webserver to load index.html as the default instead of index.php.
The httpd.conf file has "DirectoryIndex index.html index.html.var index.php"
I have a .htaccess file in my html directory with this as the first line "DirectoryIndex index.html index.htm index.php"
I've got another .htaccess file in the subfolder that I actually need the change in with this as the first line "DirectoryIndex index.html index.htm index.php"
What am I missing? Why won't it load index.html instead of index.php
I need the webserver to load index.html as the default instead of index.php.
The httpd.conf file has "DirectoryIndex index.html index.html.var index.php"
I have a .htaccess file in my html directory with this as the first line "DirectoryIndex index.html index.htm index.php"
I've got another .htaccess file in the subfolder that I actually need the change in with this as the first line "DirectoryIndex index.html index.htm index.php"
What am I missing? Why won't it load index.html instead of index.php
ASKER
hey @kuzmanovicb
both htaccess files now have DirectoryIndex index.html as the first thing
and the httpd.conf file has DirectoryIndex index.html and it is still loading .php first
I also ran "sudo /etc/init.d/httpd restard" and I got no change
both htaccess files now have DirectoryIndex index.html as the first thing
and the httpd.conf file has DirectoryIndex index.html and it is still loading .php first
I also ran "sudo /etc/init.d/httpd restard" and I got no change
with "DirectoryIndex index.html index.html.var index.php" index.php should be loaded only if index.html and index.html.var does not exist.
Can you try without index.php, edit to be like this: "DirectoryIndex index.html" and tell me what happens
Can you try without index.php, edit to be like this: "DirectoryIndex index.html" and tell me what happens
ASKER
That is what I tried in my last comment and it is still pulling php
the .htaccess file next to the index files has this
DirectoryIndex index.html
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
while the one in the root has
DirectoryIndex index.html
# BEGIN WordPress
# END WordPress
RewriteEngine on
#if the site is placed in the root folder of the domain,
#the following line should be: RewriteBase /
#it also may be unnecessary - this depends on the server configuration
#example set /revou/ if setup url is yoursite.com/demo, set / if setup url is yoursite.com
RewriteBase /twit/
#
##please DO NOT edit these lines:
RewriteRule ^(css|js|grafika|sample_ph otos|avata rs25|avata rs_mini|re sources|aj ax|colourm od|rss|bac kgrounds|b glib|admin login|visi on|post_im g|logo|db_ backup) - [L]
RewriteRule ^api\/ - [L]
RewriteRule ^(logout.php|randompic.php |sticker_d ata.php|my _status.ph p|sticker. swf|delete _me.php|ge t_sms.php) - [L]
#RewriteRule ^.*$ index.php
RewriteRule ^[^/].*$ index.php
you see anything in there?
the .htaccess file next to the index files has this
DirectoryIndex index.html
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
while the one in the root has
DirectoryIndex index.html
# BEGIN WordPress
# END WordPress
RewriteEngine on
#if the site is placed in the root folder of the domain,
#the following line should be: RewriteBase /
#it also may be unnecessary - this depends on the server configuration
#example set /revou/ if setup url is yoursite.com/demo, set / if setup url is yoursite.com
RewriteBase /twit/
#
##please DO NOT edit these lines:
RewriteRule ^(css|js|grafika|sample_ph
RewriteRule ^api\/ - [L]
RewriteRule ^(logout.php|randompic.php
#RewriteRule ^.*$ index.php
RewriteRule ^[^/].*$ index.php
you see anything in there?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
alright, something is up cause both .htaccess files are set to
"DirectoryIndex index.html"
and that is it and it still isn't working.
Should I try restarting my whole server not just apache?
Or is there something else going on
"DirectoryIndex index.html"
and that is it and it still isn't working.
Should I try restarting my whole server not just apache?
Or is there something else going on
DirectoryIndex as others pointed out is only one way to direct apache to determine which file will be loaded when one is not specified.
One would need to see the entire config to see what and where the direction is to load the index.php.
One would need to see the entire config to see what and where the direction is to load the index.php.
ASKER
I was working off a VPS from a company that is sinking. They take terrible care of their servers and once I switched to a different company I never had this problem again.
Best Regards