httpd.conf match absolute file

Posted on

httpd.conf match absolute file – Managing your servers can streamline the performance of your team by allowing them to complete complex tasks faster. Plus, it can enable them to detect problems early on before they get out of hand and compromise your business. As a result, the risk of experiencing operational setbacks is drastically lower.

But the only way to make the most of your server management is to perform it correctly. And to help you do so, this article will share nine tips on improving your server management and fix some problem about apache-2.2, httpd, files, httpd.conf, .

I have the following directory statement in my httpd.conf for a virtualhost.

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

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)

Edit

I just realize i could do something like;

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

Untested though, but should work in theory, right?

Edit 2

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

Solution :

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

Leave a Reply

Your email address will not be published.