1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

index.php not picked up as default page

Discussion in 'General Discussion' started by charlieperry, May 10, 2007.

  1. charlieperry

    charlieperry New Member

    Joined:
    May 10, 2007
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    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?
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,288
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    Houston, TX
    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.
     
  3. jrafuse

    jrafuse New Member

    Joined:
    Mar 14, 2004
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    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!
     
  4. ashokpomnar

    ashokpomnar New Member

    Joined:
    Sep 30, 2006
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    Hello,

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

    DirectoryIndex index.php
     
  5. yapluka

    yapluka Member

    Joined:
    Dec 24, 2003
    Messages:
    302
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    France
    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
     
  6. jrafuse

    jrafuse New Member

    Joined:
    Mar 14, 2004
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Thanks :)

    John
     

Share This Page