Log in

View Full Version : Priority of index.* files



Objectivity
01-16-2009, 03:01 PM
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.

Twey
01-16-2009, 03:06 PM
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.

QuinS33
01-17-2009, 06:28 AM
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.