charlieperry

Registered
May 10, 2007
1
0
151
I have set up a wordpress blog in my website. It seems to working fine. The only problem is that index.php is not being picked up as the default page in the wordpress directory. I have to actually type index.php at the end of the URL. I have the same problem with the admin area.

I thought that index files were automatically set to be the default files whenever you visit a directory. Do I need to change a setting?
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
13
313
Houston, TX
cPanel Access Level
Root Administrator
You might want to check your Apache Configuration, ensure that index.php is listed in the DirectoryIndex directive.

Of course, nothing stops you from just creating a .htaccess file in that directory with the DirectoryIndex directive in it - but that's more a kludge than a solution.
 

jrafuse

Registered
Mar 14, 2004
2
0
151
In my case "index.php" is listed in the "DirectoryIndex directive", however, if there is an ".htm*" file in that directory, it is displayed first. How can I tell Apache to display the "index.php" first, if it exists along with an .htm file? I tried placing it first in the list, but no joy!
 

ashokpomnar

Active Member
Sep 30, 2006
28
0
151
In my case "index.php" is listed in the "DirectoryIndex directive", however, if there is an ".htm*" file in that directory, it is displayed first. How can I tell Apache to display the "index.php" first, if it exists along with an .htm file? I tried placing it first in the list, but no joy!
Hello,

Please create .htaccess file and add following line in it.

DirectoryIndex index.php
 

yapluka

Well-Known Member
Dec 24, 2003
301
2
168
France
cPanel Access Level
Root Administrator
Like David explained, you can add the directive in your .htaccess if you want the change to apply to your site only :

Code:
DirectoryIndex index.php index.htm index.html index.shtml index.xhtml index.wml index.perl index.pl index.plx index.ppl index.cgi index.jsp index.js index.jp index.php4 index.php3 index.phtml default.htm default.html home.htm
If you want it to apply to all sites, please read my other post here : http://forums.cpanel.net/showpost.php?p=344262&postcount=10

Don't forget that your list should look like this :
DirectoryIndex index.php index.htm index.html index.shtml index.xhtml index.wml index.perl index.pl index.plx index.ppl index.cgi index.jsp index.js index.jp index.php4 index.php3 index.phtml default.htm default.html home.htm