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

/MyWebApp1
/MyWebApp2
/MyWebApp3
/Common
  /css
  /images
  /script

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.

link|improve this question

feedback

1 Answer

up vote 1 down vote accepted

Following should work:

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

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

See also:

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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