The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

want to switch hom page from index.html to index.php

Discussion in 'General Discussion' started by websoftbiz, Jul 11, 2008.

  1. websoftbiz

    websoftbiz Member

    Joined:
    Jul 11, 2008
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Hi,
    I am new to this panel. I have website keepitinthecloset.com. when i type that url it opens index.html page. But now i got new page index.php. I want this page as my default page. so when people type keepitinthecloset.com then it should opne index.php page. How can i make that change. someone told me htaccess file. if i have to make changes there then where is this file located and what kind of changes i have to make that index.php as my default home page.

    Any help will be appreciated.

    Thanks,
     
    #1 websoftbiz, Jul 11, 2008
    Last edited by a moderator: Jul 11, 2008
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,449
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Both pages work, try them. Don't want to use index.html? Rename it to index.html.OLD for now.
     
  3. mtindor

    mtindor Well-Known Member

    Joined:
    Sep 14, 2004
    Messages:
    1,279
    Likes Received:
    36
    Trophy Points:
    48
    Location:
    inside a catfish
    cPanel Access Level:
    Root Administrator
    If you want to have both index.html and index.php but you want index.php to be the default and it isn't, do this:

    create an .htaccess file in your public_html folder (or in whatever folder you want this to occur in) and make its contents:

    DirectoryIndex index.php index.html

    That's just an example - you can leave out whatever you want to leave out. Just use DirectoryIndex to specify the preferred index to pull first. The first on the list should be index.php. You can add others to the list as well like index.htm, home.htm, default.htm.


    Now, keep this in mind... if by default your server pulls index.html first and you want to use this method to pull index.php first in the event that both files exist in a directory, this acts recursively. So, if you have a subdirectory that you serve other content from and it has an index.php and an index.html and you wish for index.html to take precendence in that subdirectory, you'll have to add another .htaccess in there to change it back.

    Mike
     
    #3 mtindor, Jul 11, 2008
    Last edited: Jul 12, 2008
  4. websoftbiz

    websoftbiz Member

    Joined:
    Jul 11, 2008
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Thanks yo...

    I tried to rename it earlier but then default page didn't open and gave me error. page missing.

    But Mike i really appreciate your help. Thanks for your solution. It worked out perfactly fine. I spent almost 6 hours to figure it out this issue and even after that i couldn't. But now its working perfactly fine. You are the man buds.


    Once again thanks for your help....

    Bj.
     
  5. mtindor

    mtindor Well-Known Member

    Joined:
    Sep 14, 2004
    Messages:
    1,279
    Likes Received:
    36
    Trophy Points:
    48
    Location:
    inside a catfish
    cPanel Access Level:
    Root Administrator
    No problem chief. Glad i could help :)

    Mike
     
Loading...

Share This Page