Server index.html file by default

Discussion in 'Apache' started by daringtakers, Dec 11, 2008.

  1. #1
    I dont know why, but my server isn't serving the index.html file by default. what could be the problem? how to solve it?

    Its not serving index.html file for addon domains created in sub directories under www root.
     
    daringtakers, Dec 11, 2008 IP
  2. hexmax

    hexmax Peon

    Messages:
    44
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    if you use cpanel upload index.html /root/cpanel3-skel/public_html
     
    hexmax, Dec 12, 2008 IP
  3. maestria

    maestria Well-Known Member

    Messages:
    705
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    110
    #3
    Have you checked the apache conf?
    A Document root directive must be set for index.html to be accessible by default.
     
    maestria, Dec 13, 2008 IP
  4. daringtakers

    daringtakers Well-Known Member

    Messages:
    808
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    110
    #4
    I think, I dont have access to apache confo on a shared server. There must be some .htaccess hack.
     
    daringtakers, Dec 13, 2008 IP
  5. gemini777

    gemini777 Peon

    Messages:
    21
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Using a htaccess file in the root of the directory would do what you want. Add the following to your htaccess file

    DirectoryIndex index.html
     
    gemini777, Dec 13, 2008 IP
    daringtakers likes this.
  6. thegetpr

    thegetpr Banned

    Messages:
    99
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    if you are on shared server, then you dont have the root access, you have to contact your hosting provider and tell him to do they will do it for you free of cost
     
    thegetpr, Dec 14, 2008 IP
  7. daringtakers

    daringtakers Well-Known Member

    Messages:
    808
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    110
    #7
    That worked.. thanks

    +rep added
     
    daringtakers, Dec 14, 2008 IP
  8. joebert

    joebert Well-Known Member

    Messages:
    2,150
    Likes Received:
    88
    Best Answers:
    0
    Trophy Points:
    145
    #8
    You should really move that particular DirectoryIndex directive into the virtual host containers for the domains and out of htaccess.

    It's like keeping your toothbrush above your kitchen sink, it works, but it doesn't really belong there.
     
    joebert, Dec 19, 2008 IP