Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 have the following directory statement in my httpd.conf for a virtualhost.

<Directory c:/foo/bar/*/*/baz>
    <Files index.php>
        # something file specific

This matches "c:/foo/bar/ * / * /baz/index.php" but also "index.php" in subdirectories..

I would like it to only match "index.php" directly within /baz (e.g. absolute file path), any ideas?

Im relatively new to server configuration so its a bit trial and error for me. (Wamp installation on windows 7 64bit)


I just realize i could do something like;

<Directory /foo/bar>
    <Files index.php>
        # something file specific
    <Directory /*>
        <Files index.php>
            # revert/undo something file specific

Untested though, but should work in theory, right?

Edit 2

SOLVED! <Location /index.php> seems to does the trick...

share|improve this question
Please create an answer for your question and accept it. – Iain Apr 23 '11 at 11:12
yes, create an answer, but I wouldn't accept <Location> if I were you as it is parsing the URI instead of the directory structure... – asdmin Jun 17 '11 at 16:06
up vote 1 down vote accepted

Check the location attribute - that might be where your problem is.

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.