index.php instead of index.html

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
craginweb
Forum Newbie
Posts: 13
Joined: Fri Jul 05, 2002 12:49 am
Location: FWB Florida

index.php instead of index.html

Post by craginweb »

Is there a way to make my index.php page load by default instead of using index.htm or index.html?
I have tried creating an index.html then using a meta tag redirect:

Code: Select all

<META http-equiv="refresh" content="0;URL=index.php">
Although this works I am certain I have been to pages where the php page loads by default, I just cant seem to make mine work.

What I am trying to acheive is that when people go to my site they see
http://www.madeupsite.com/ (which would load the index.php)
instead of http://www.madeupsite.com/index.php (which is actually the second page loaded)

I am thinking this has something to do with the configuration of the Apache server, any ideas?

thanks,
craginweb
User avatar
hob_goblin
Forum Regular
Posts: 978
Joined: Sun Apr 28, 2002 9:53 pm
Contact:

Post by hob_goblin »

if your using apache look for a file named "httpd.conf" it should be in the apache/conf folder, then scroll down to the line where it says

Code: Select all

#
# DirectoryIndex: Name of the file or files to use as a pre-written HTML
# directory index.  Separate multiple entries with spaces.
#
<IfModule mod_dir.c>
    DirectoryIndex index.html
    DirectoryIndex index.php
</IfModule>
and just edit that in the order you want it
craginweb
Forum Newbie
Posts: 13
Joined: Fri Jul 05, 2002 12:49 am
Location: FWB Florida

Post by craginweb »

another problem solved.

thanks hob_goblin
Post Reply