0

Folks, I'm trying to grapple with something which is making my head spin. I wonder if someone might have an idea on this.

It's well understood, that a webserver can supply a specified file, by default, if no page is specified on the URL:
eg.
http://www.london.edu/index.html
can be requested by the URL
http://www.london.edu/
because index.html is configured as a default page.

I'm trying to discover if Apache offers the feature to specify the default page on a folder-by-folder basis.
eg.

http://www.london.edu/index.html
can be requested by the URL
http://www.london.edu/
by configuring index.html as a default page for the root folder.

and also

http://www.london.edu/phd/phd.html
can be requested by the URL
http://www.london.edu/phd/
by configuring phd.html as a default page for the phd folder.

and also

http://www.london.edu/mba/mba.html
can be requested by the URL
http://www.london.edu/mba/
by configuring mba.html as a default page for the mba folder.

etc.

I'm not sure if I'm reading it right, but this page may have some bearing.
http://httpd.apache.org/docs-2.0/mod/mod_dir.html

Many thanks for any light you can shed on this. I'm certainly in the dark.

2
Contributors
3
Replies
4
Views
12 Years
Discussion Span
Last Post by techhelpforme
0

You will want to add:

DirectoryIndex

to the .htaccess file for each directory. There may be another way to do this, but this should work.

So for example:

In the directory: phd/
add this line to your .htaccess: DirectoryIndex phd.html

0

And it worked....

Using Apache on Windows:
1. Install.
2. Modified httpd.conf to change "AllowOverride None" to "AllowOverride All"
3. Created folder called phd within folder htdocs.
4. Put a file in this folder, called phd.html
5. Used command line to create .httaccess in the folder phd.
6. Put one line in the .htaccess file: DirectoryIndex phd.html
7. Restarted the server.

RESULT!!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.