Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-05-31 18:49:10

fjdekermadec
New Member
From: Paris, France
Registered: 2010-05-30
Posts: 7

Apache mod_rewrite inheritance

Hello all,

While toying with Textpattern’s clean URLs, I have been noticing some strange behaviour in Apache’s mod_rewrite. By “strange,” I mean, of course, that I am having trouble wrapping my mind around it, not that I have single-handedly uncovered a bug in the server…

The Apache documentation states that:

In per-directory context […] conditions and rules of the parent directory’s .htaccess configuration are inherited [if RewriteOptions inherit is set].

I find this to be true for filesystem mapping — for example, mapping a file name to another in a directory. However, rules that analyse and act upon query strings, URLs, and other non-filesystem-related parameters appear to be inherited automatically, whether this property is set or not — like other declarations in .htaccess.

For example, setting the following will require the Inherit property to work down the server chain:

RewriteRule ^promotion.jpg$ beachFun.jpg [NC,L]

But the below will work regardless of whether the property is set:

RewriteCond %{HTTP_REFERER} ^(<|>|’|%0A|%0D|%27|%3C|%3E|%00) [NC,OR]

Could someone help me understand the reason behind this behaviour?

Offline

Board footer

Powered by FluxBB