1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

index.html wins over index.php?

Discussion in 'HTML & Website Design' started by paradox, Nov 20, 2004.

  1. #1
    If I have both an index.html and an index.php in my root directory "public_html". Will the index.html file always show when someone visits the web site. Does index html trump index php as first choice page display?

    Why I'm asking is because I'm installing a php script onto an existing web site that has static pages and constant visitors. This php script is one where you go through the setup install by going to www.website.com/index.php. My inital problem was how do run the setup script for the config connects etc. If all of the usual visiters see the index.php before I get to it to run it there could be probs. The site is active and I was worried that anyone could start pressing whatever setup steps buttons before I got to it and then mess it up. I thought of password protecting the entire public_html directory to let me have the 5 minutes necessary to install the script but if index.html always shows first to index.php then I have no problem and can connect to index.php to trigger the setup/install process behind the scenes and then after the install I simply delete the original index.html.

    Would that work ok?
     
    paradox, Nov 20, 2004 IP
  2. melfan

    melfan Peon

    Messages:
    644
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #2
    it depends on the setting of your site. you can ask your hosting company to verify if it follow index.html over other default document.
     
    melfan, Nov 20, 2004 IP
  3. Daniel

    Daniel Peon

    Messages:
    1,453
    Likes Received:
    70
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Paradox,

    That should work fine. Usually the webserver if (apache) has index.html as the first file to call when a request is sent to the folder.

    So having that in there should always bring up the html file before the php.

    Then just remove the html file when your ready like you said.
     
    Daniel, Nov 20, 2004 IP
  4. minstrel

    minstrel Illustrious Member

    Messages:
    15,082
    Likes Received:
    1,243
    Best Answers:
    0
    Trophy Points:
    480
    #4
    Daniel:

    You need to have a look at your home page for http://thor.zynetonline.com/ at 800x600 -- your frames are messed up so the left login column is cut off at the right, and the italics-lightening bolt font on the graphics in the right hand pane are almost illegible.
     
    minstrel, Nov 20, 2004 IP
  5. Daniel

    Daniel Peon

    Messages:
    1,453
    Likes Received:
    70
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Hehehehe I know Minstrel :)

    Thanks for the feedback.

    The site is going under a complete face lift and will look much better especially after Kalina designs the front end :)

    I know how to code in perl much better than design in photoshop :)

    Thanks again for the advice keep it coming !

    By the way Nice to meet a fellow Ottawaian! hehehe
     
    Daniel, Nov 20, 2004 IP
  6. minstrel

    minstrel Illustrious Member

    Messages:
    15,082
    Likes Received:
    1,243
    Best Answers:
    0
    Trophy Points:
    480
    #6
    Depending on the server or how it is configured, the hierarchy of "default" pages will vary, generally among index.html, default.html, or home.html (or their cousins index.htm, default.htm, or home.htm), but as Daniel said I don't think I've ever seen one where the default was index.php...
     
    minstrel, Nov 20, 2004 IP
  7. Daniel

    Daniel Peon

    Messages:
    1,453
    Likes Received:
    70
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Its really easy for the SERVER ADMIN to change in the config file.

    something like

    /usr/local/apache2/conf/httpd.conf

    the line is easy to find and I think. Im not sure but I think the first file listed will be the one to take default hmmmm let me find the line.

    This is how I configure my web servers.

    DirectoryIndex index.html index.htm index.php index.pl index.cgi

    As you can see index.html is stated first so it would be the default index file. If I mod to this

    DirectoryIndex index.php index.html index.htm index.pl index.cgi

    then php would be the default.
     
    Daniel, Nov 20, 2004 IP
  8. Blogmaster

    Blogmaster Blood Type Dating Affiliate Manager

    Messages:
    25,924
    Likes Received:
    1,354
    Best Answers:
    0
    Trophy Points:
    380
    #8
    Minstrel, your forums are pretty cool, I know our sites are not related but we can still trade resources if you'd like.

    Mike
     
    Blogmaster, Nov 20, 2004 IP
  9. cyanide

    cyanide Peon

    Messages:
    483
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Failing access to your conf file, you can force your home page to be whatever you want it to be by inserting
    DirectoryIndex default.php
    Code (markup):
    in an .htaccess file and put it in your root directory

    replace default.php with what ever your file is called that you want to be the home page
     
    cyanide, Nov 22, 2004 IP
  10. Blogmaster

    Blogmaster Blood Type Dating Affiliate Manager

    Messages:
    25,924
    Likes Received:
    1,354
    Best Answers:
    0
    Trophy Points:
    380
    #10
    as long as the links on index.html are right and lead to the right php pages, you can always optimize a php site in html just like html
     
    Blogmaster, Nov 22, 2004 IP
  11. minstrel

    minstrel Illustrious Member

    Messages:
    15,082
    Likes Received:
    1,243
    Best Answers:
    0
    Trophy Points:
    480
    #11
    Assuming, of course, it's an Apache server and that your host permits htaccess files.
     
    minstrel, Nov 22, 2004 IP