Postings by Nigel Peck

AllowOverride - Mis-behaving Default


According to the documentation[1], the default for `AllowOverride` is
`None`, and when `AllowOverride` is set to `None`, .htaccess files are
not read at all.

When I set `AllowOverride` to `None` explicitly, I find that is the
behaviour I see, but when I don't specify it at all, the .htaccess file
is still read and I receive a ".htaccess: [...] not allowed here" error.

mod_rewrite - Setting Environment Variables


I am having trouble with how mod_rewrite handles environment variables
that are set with the [E=VAR:VAL] flag for RewriteRule. I am setting an
environment variable to prevent a loop. The logs show it is set, and
then matched, but then on the subsequent iteration of the rules it is no
longer set (so the loop occurs that it is supposed to prevent).

The directives I am testing with are:

RewriteRule ^((?!pages/).*)$ pages/$1 [env=rewritten:1]

RewriteCond %{ENV:rewritten} !=1
RewriteRule ^pages(/.*)$ $1 [R=301,L]

One cycle of the log output is below.