Summary: | RewriteRule cannot be made to inherit the matching Directory directive rules in .htaccess files | ||
---|---|---|---|
Product: | Apache httpd-2 | Reporter: | Viktor Szépe <viktor> |
Component: | Core | Assignee: | Apache HTTPD Bugs Mailing List <bugs> |
Status: | NEW --- | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | 2.4.23 | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Linux |
Description
Viktor Szépe
2016-08-01 11:44:55 UTC
https://httpd.apache.org/docs/2.4/sections.html also says: If multiple <Directory> sections apply to the same directory they are processed in the configuration file order. Does RewriteOptions Inherit change the behavior? (In reply to Eric Covener from comment #2) > Does RewriteOptions Inherit change the behavior? Thank you very much for your comment. It solved the two Directory directives problem. I've noticed that the .htaccess in the same directory overrides the rewite rules. I've tried placing RewriteOptions Inherit into the .htaccess file at several places with no success. Could it be solved somehow? (In reply to Szépe Viktor from comment #3) > (In reply to Eric Covener from comment #2) > > Does RewriteOptions Inherit change the behavior? > > Thank you very much for your comment. > It solved the two Directory directives problem. > > I've noticed that the .htaccess in the same directory overrides the rewite > rules. > I've tried placing RewriteOptions Inherit into the .htaccess file at several > places with no success. > Could it be solved somehow? I would have thought it would behave the same -- the htaccess rules replace the matching <Directory> rules unless you tell it to inherit in that rewrite-specific way. > I would have thought it would behave the same -- the htaccess rules replace > the matching <Directory> rules unless you tell it to inherit in that > rewrite-specific way. Thank you again. A temporary word-aroung could be to use the DirectoryMatch directive as it will surely override directory rules. http://httpd.apache.org/docs/2.4/sections.html#merging A strange (for me at least) fact is: Rewrite order is: DirectoryMatch -> .htaccess -> Directory But if any of these matches - regardless of [L] or [END] - rewrite processing stops there. |