Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: home page

  1. #1
    Regular Coder
    Join Date
    Nov 2002
    Thanked 0 Times in 0 Posts

    home page

    if the name of my homepage wasn't index.* (for example www.myweb.com/home.php), how can i inform the server about it?

  • #2
    Mega-ultimate member
    Join Date
    Jun 2002
    Winona, MN - The land of 10,000 lakes
    Thanked 45 Times in 42 Posts
    Depends, what are you using for a web server? Apache? IIS?

  • #3
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Marion, IA USA
    Thanked 83 Times in 82 Posts
    Assuming you are using Apache webserver....

    Well if you are allowed to use .htaccess files you can change the default index page to whatever you want. What you would do is create a .htaccess file and put it in the root folder of your webspace. The commands will apply to all subdirectories as well as the current directory it is placed in.

    As for the command to put in the file you simply need this:

    DirectoryIndex home.php

    You can add more to the list if you need them. For example:

    DirectoryIndex home.php index.php index.html home.html foobar.htm

    What happens is when a directory is requested by the browser it will go through this list from left to right and look for a matching file in that directory. Now if for some reason you happened to have more than one of those files listed actually in the directory I think the ones listed first have priority. So for example if you had both an home.php and a index.php it would go to home.php since it is listed first in that list.
    CodingForums Supreme Overlord
    All Hail Spookster


    Posting Permissions

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