Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am serving a collection of Web applications from a Windows machine running Apache. My document root has the following contents:


I want that index.php be served whenever the root folder, or a folder corresponding to a Web application is specified:

/          ==> /index.php
/MyWebApp1 ==> /MyWebApp1/index.php
/MyWebApp2 ==> /MyWebApp2/index.php
/MyWebApp3 ==> /MyWebApp3/index.php

But I don't want to specify a directory index for /Common and its subfolders:

/Common        ==> Error 403
/Common/css    ==> Error 403
/Common/images ==> Error 403
/Common/script ==> Error 403

How can I do that?

EDIT: By the way, the number of Web applications I am hosting will grow in the future, and I don't want to reconfigure Apache each time I add a Web application. Explicitly enumerating each MyWebApp<i> is not satisfactory.

share|improve this question
up vote 1 down vote accepted

Following should work:

<Location />
     Options +Indexes
<Location /Common>
    Options -Indexes

You might use this on server level (not inside VirtualHost) if your apps are in different hosts.

See also:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.