PDA

Click to See Complete Forum and Search --> : [RESOLVED] Replace the default page in http://localhost


mar_zim
May 6th, 2006, 01:03 AM
I have installed apache web server successfully and seeing the page notifying that installation of the Apache web server software on this system was successful...blah.blah..

What I want to achieve is that replace that page.
i.e When I type in a web browser http://localhost it will load another page not the page of confirmation about apache installation. How to do that?


thanks in advance.

penagate
May 6th, 2006, 01:12 AM
The directory index page is determined by a list of possible file names which Apache searches for one by one. I believe it goes something like

index.php,index.html,index.htm ... etc.

so you need to replace the one that's currently being displayed, with your own. Unless you've configured it differently the default base directory is /htdocs so look for the files in there.

mar_zim
May 6th, 2006, 01:33 AM
What do you mean?
I've look through the httpd.default.conf file and found the DirectoryIndex index.html index.html.var and change it to DirectoryIndex index.php then restart the web server but still it display the default one not the file I created(index.php).

penagate
May 6th, 2006, 02:18 AM
If you have a .htaccess file in any directory, that will override any .htaccess file in any higher level directory, which override any config files. So put the DirectoryIndex line in the .htaccess file and then your index.php file should be selected.

(Sorry, meant to post this earlier but forgot about it)

mar_zim
May 6th, 2006, 02:55 AM
I've searched about htaccess file and come up htaccess.html? Is that file what you mean? If it is then I put the directoryindex line in that file considering the index.php selected but still it wont work. :(

I'm really lost. :(

penagate
May 6th, 2006, 02:56 AM
No its supposed to be called ".htaccess". Are you viewing it through a Unix shell or FTP? If so then it will be hidden (because of the starting dot). You need to either turn on showing hidden files (somehow) or just upload a file called ".htaccess" and overwrite it.

mar_zim
May 6th, 2006, 03:37 AM
Pen can I create an .htaccess file in htdocs directory and put the line directoryindex index.php?

mar_zim
May 6th, 2006, 03:49 AM
or If I will create an .htaccess file what directory should I save it?

penagate
May 6th, 2006, 03:58 AM
In the directory where your file is going to be. .htacess files affect the directory they're in and all directories inside that one (unless overriden by another in a subdirectory).

visualAd
May 6th, 2006, 03:58 AM
Delete all the files from c:\program files\apache group\apache2\htdocs except index.php; that worked for me.

mar_zim
May 6th, 2006, 04:09 AM
I've read a lot of pages discussing about .htaccess file. I've come up making an .htaccess file and the content is just a single line which is directoryindex index.php and save it in htdocs directory. Restart the apache server then access the localhost then viola it wont work. :( same page loaded the default page. :(

*now I have a heavy heart*

penagate
May 6th, 2006, 04:29 AM
Do you have PHP installed and configured properly? If you go to localhost/index.php does it work?

and was it DirectoryIndex not directoryindex? It's case sensitive I think.

mar_zim
May 6th, 2006, 04:34 AM
Yeah I've installed it properly no worries running localhost/index.php.

I've also write it in correct case. DirectoryIndex index.php

visualAd
May 6th, 2006, 05:32 AM
Have you tried Cntrl+F5?

mar_zim
May 7th, 2006, 08:39 PM
Have you tried Cntrl+F5?

Good cntrl+f5 do the trick.

and oh I deleted the .htaccess file and still it works. why?

penagate
May 7th, 2006, 08:44 PM
What you had in it is the default.

mar_zim
May 7th, 2006, 08:47 PM
So you could change the default page w/out the use of .htaccess file?

penagate
May 7th, 2006, 09:12 PM
Yea, it's just better to use a htacess file as otherwise you affect the entire site and that's not something you usually do in a hosted situation. If you're hosting yourself then no problems.