Search code examples
apachedirectoryindex

Apache - disable single option override


How do I disable single option override in specific folder in Apache? I'd like to force DirectoryIndex value in specific folder, so DirectoryIndex option in .htaccess of that folder will be ignored. I'd expect configuration should look somehow similar, but neither works:

<Directory "/home/me/www/symfonyProject1">
    DirectoryIndex app_dev.php
    AllowOverride -Indexes
</Directory>

or this

<Directory "/home/me/www/symfonyProject1">
    DirectoryIndex app_dev.php
    AllowOverride Options=-DirectoryIndex
</Directory>

Is this even possible? How could I achieve that?

Using: Apache/2.2.8 (Win32) & Windows 7 x64


Solution

  • The only possiblility, even though it is definitely not kosher, is to let .htaccess be ignored by versioning system locally. Then you can change as you wish to adapt you instance.

    In case you need to change original .htaccess, you must do following (for GIT):

    1. backup your modified .htaccess file
    2. Comment out line .htaccess in file .git/info/exclude
    3. do git checkout -- .htaccess to retrieve original file
    4. modifiy and commit changes
    5. Uncomment .htaccess line in .git/info/exclude
    6. Copy modified .htaccess from backup to working tree