|
-
May 6th, 2006, 01:03 AM
#1
Thread Starter
Frenzied Member
[RESOLVED] Replace the default page in http://localhost
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.
-
May 6th, 2006, 01:12 AM
#2
Re: Replace the default page in http://localhost
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.
-
May 6th, 2006, 01:33 AM
#3
Thread Starter
Frenzied Member
Re: Replace the default page in http://localhost
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).
-
May 6th, 2006, 02:18 AM
#4
Re: Replace the default page in http://localhost
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)
-
May 6th, 2006, 02:55 AM
#5
Thread Starter
Frenzied Member
Re: Replace the default page in http://localhost
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.
-
May 6th, 2006, 02:56 AM
#6
Re: Replace the default page in http://localhost
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.
-
May 6th, 2006, 03:37 AM
#7
Thread Starter
Frenzied Member
Re: Replace the default page in http://localhost
Pen can I create an .htaccess file in htdocs directory and put the line directoryindex index.php?
-
May 6th, 2006, 03:49 AM
#8
Thread Starter
Frenzied Member
Re: Replace the default page in http://localhost
or If I will create an .htaccess file what directory should I save it?
-
May 6th, 2006, 03:58 AM
#9
Re: Replace the default page in http://localhost
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).
-
May 6th, 2006, 03:58 AM
#10
Re: Replace the default page in http://localhost
Delete all the files from c:\program files\apache group\apache2\htdocs except index.php; that worked for me.
-
May 6th, 2006, 04:09 AM
#11
Thread Starter
Frenzied Member
Re: Replace the default page in http://localhost
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*
-
May 6th, 2006, 04:29 AM
#12
Re: Replace the default page in http://localhost
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.
-
May 6th, 2006, 04:34 AM
#13
Thread Starter
Frenzied Member
Re: Replace the default page in http://localhost
Yeah I've installed it properly no worries running localhost/index.php.
I've also write it in correct case. DirectoryIndex index.php
-
May 6th, 2006, 05:32 AM
#14
Re: Replace the default page in http://localhost
-
May 7th, 2006, 08:39 PM
#15
Thread Starter
Frenzied Member
Re: Replace the default page in http://localhost
 Originally Posted by visualAd
Have you tried Cntrl+F5?
Good cntrl+f5 do the trick.
and oh I deleted the .htaccess file and still it works. why?
-
May 7th, 2006, 08:44 PM
#16
Re: Replace the default page in http://localhost
What you had in it is the default.
-
May 7th, 2006, 08:47 PM
#17
Thread Starter
Frenzied Member
Re: Replace the default page in http://localhost
So you could change the default page w/out the use of .htaccess file?
-
May 7th, 2006, 09:12 PM
#18
Re: Replace the default page in http://localhost
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|