Forum Moderators: phranque

Message Too Old, No Replies

restrain the browser from displaying the document root directory

configure Apache document root directory instead of index

         

efrenmsandoval

10:25 pm on Dec 17, 2006 (gmt 0)

10+ Year Member



Please help me with this.

I recently had installed Apache 2.0 and did everything the installation guide told me to do. Afterwards I installed PHP 5 then MySQL. Things are generally working fine. My IE7 displayed the default Apache welcome page after the installation. I also made the famous phpinfo.php file containing

<?php phpinfo();?>

It worked also as expected, displaying my entire configuration, et cetera. I started to load pages in C:\Apache2\htdocs, which is the document root directory in the httpd configuration.

What bothers me is that when I open [localhost...] (or let say, the servername in my configuration), the browser displays a list of everything, from directories to files, inside C:\Apache2\htdocs (the classical 'Index of/' page); instead of displaying only the index [.htm, .html, php, so on] file which I guess is what is supposed to puff out. When I click on the the entry for the index [.htm, .html, php, so on] file from the long list of links in the annoying 'Index of/' page, it is the only time the browser loads the page I made for ours and things work out fine.

I just want to ask anybody to help me configure Apache such that when I type my servername and go for it, the browser will never show the 'Index of/' page again, and of course, will not let my machine expose everything inside C:\Apache2\htdocs. I want my index [.htm, .html, php, so on] file to load automatically. Please help me do so.

Thanks a lot. :-)

[edited by: jdMorgan at 3:23 am (utc) on Dec. 18, 2006]
[edit reason] Speling [/edit]

jdMorgan

3:24 am on Dec 18, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



See DirectoryIndex and Options -Indexes in Apache mod_dir and Apache core documentation, respectively.

Jim

efrenmsandoval

5:54 am on Dec 18, 2006 (gmt 0)

10+ Year Member



Thank's a lot.
It's working.
I should have visited [httpd.apache.org...]
first... just showed to everyone that I almost know nothing. :)