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

How do I have a current directory .htaccess ignore Options from upper directory .htaccess?

share|improve this question

2 Answers 2

up vote 6 down vote accepted

Simply specify what you want at the current level (and subseqently). If you want it all disabled just:

Options None

Or if you want to disable particular features for example:

Options -Index -ExecCGI

Or if you want to enable additional directive:

Options +Includes

If you want just one feature turned on, it's really nice and readable if you are explicit about it:

Options None +FollowSymLinks
share|improve this answer
    
This doesn't work as .htaccess directives cascade downwards. I need a way to block that functionality; preferably in the .htaccess file. –  josten Mar 22 '13 at 4:51
1  
I just double checked on Apache httpd 2.2.24, works exactly as I described. –  Chris S Mar 22 '13 at 12:55
    
@JMoore Are you sure? Have you tried it? What problems are you experiencing? –  Dan Mar 22 '13 at 13:01

The .htaccess documentation covers this very well, all you have to do is specify them and the later ones will override the earlier ones

The configuration directives found in a .htaccess file are applied to the directory in which the .htaccess file is found, and to all subdirectories thereof. However, it is important to also remember that there may have been .htaccess files in directories higher up. Directives are applied in the order that they are found. Therefore, a .htaccess file in a particular directory may override directives found in .htaccess files found higher up in the directory tree. And those, in turn, may have overridden directives found yet higher up, or in the main server configuration file itself.

share|improve this answer

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.