Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Jul 2008
    Posts
    7

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

    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,
    Last edited by Infopro; 07-11-2008 at 08:11 PM.

  2. #2
    cPanel Product Evangelist Infopro's Avatar
    Join Date
    May 2003
    Location
    Pennsylvania
    Posts
    7,165
    cPanel/Enkompass Access Level

    Root Administrator

    Lightbulb

    Both pages work, try them. Don't want to use index.html? Rename it to index.html.OLD for now.

  3. #3
    Member
    Join Date
    Sep 2004
    Posts
    887

    Default

    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
    Last edited by mtindor; 07-12-2008 at 08:15 PM.

  4. #4
    Member
    Join Date
    Jul 2008
    Posts
    7

    Default

    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. #5
    Member
    Join Date
    Sep 2004
    Posts
    887

    Default

    No problem chief. Glad i could help

    Mike

Similar Threads & Tags
Similar threads

  1. Which page do you want to load first index.html or index.htm?
    By BianchiDude in forum cPanel and WHM Discussions
    Replies: 22
    Last Post: 04-10-2008, 10:36 AM
  2. Addon domains not reading index.htm or .html or any index files
    By Chew in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 02-17-2008, 10:32 AM
  3. FrontPage suddenly changing index.htm to index.html
    By myce in forum cPanel and WHM Discussions
    Replies: 27
    Last Post: 10-05-2005, 12:23 AM
  4. Replies: 4
    Last Post: 05-15-2004, 06:32 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube