Question

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

Was it helpful?

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

OTHER TIPS

I did not get this working with the <Directory> tag in httpd.conf but it was working if I did the following:

In /home/me/www/symfonyProject1 create a .htaccess file and put DirectoryIndex app_dev.php in it.

This should work as long as you AllowOverride All (Or more narrow if needed) in the parent configuration.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top