Results 1 to 3 of 3

Thread: Priority of index.* files

  1. #1
    Join Date
    Feb 2007
    Posts
    16
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Priority of index.* files

    I have a site with a homepage that's index.php. For a few weeks, we want to have a splash page precede this that gives users the option to choose between two different sites.

    Initially, I thought I would rename the index.php file as something else (say index2.php) and name the splash page index.php. Then I realized that links back to home on the site would then go back to the splash rather than the main page.

    Is there a way that I can have browsers go to index.htm prior to index.php? What is the hierarchy of use for index files?

    The pages in question are:
    www.girlscoutsjs.org/index.php (the site that's typically the main page)
    www.girlscoutsjs.org/splash.php (the page I want to make index.htm, there is no php scripting on this page)


    Thanks for your help.

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    The priority is specified by the order in which they're mentioned in your webserver config.

    The only real option is to update your 'home' links. You can use cookies to only display the splash page once, but then the user won't be able to decide to check out the other site until the cookie has expired.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Jan 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    This is an easy fix. You should have a file in your home directory named .htaccess (including the period). If not create a new file named ".htaccess" in the home directory. This is a directory specific Apache config file (I am assuming you are using Apache).

    Add this line to .htaccess:

    DirectoryAccess index.htm index.php

    More in-depth explaination:
    http://www.modwest.com/help/kb1-147.html

    Edit: Twey is right tho. Repeatedly visiting a splash page is annoying to users, unless its only temp. The cookie suggestion is a good one.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •