Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

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:

share|improve this answer
add comment

Your Answer

 
discard

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.