* Mads Toftum wrote:

> On Thu, Feb 27, 2003 at 03:07:31PM +0100, André Malo wrote:
>> RewriteOptions MaxRedirects=x
>>
>> where x defaults to 10 or so.
>> mod_rewrite could store that value in r->request_config. If it's exceeded,
>> a config error is assumed and an error logged. The response should be 500
>> then.

> Generally I like the idea, but I'm a bit wary about setting a default value
> other than unlimited because it could break existing configs.

hmm, the idea behind is actually to break the configs (anyway) to prevent 
the server from crashing. 10 internal redirects are already a lot ones. But 
however, we could let it default to, 20, 50 or 100. I don't believe that 
such a high value would break any config (it's probably already broken then 
...). YMMV. Some more opinions about that point are welcome.

> The other
> thing I'm not quite sure about is how you would make this work for rules
> in .htaccess? (but I may be missing something)

It's actually only interesting for .htaccess files (resp. directory 
context). Because the rules there are handled in the fixup hook (+ 
redirect-handler) which causes mostly internal redirects. In server context 
the rules are handled in the translate_name hook and don't issue an 
internal redirect.

So, to be more exact, the implementation would be: mod_rewrite counts every 
time it runs the redirect-handler and after $limit it refuses to run it 
again with a 500 + errorlog entry.

Breaking existing configs with a limit of, for instance, 10 would mean, you 
have .htaccess(!)-configs that let the server run ten times into a rule 
that issues an internal redirect to elsewhere. While processing _one_ 
request - wow!

nd
-- 
>kann mir jemand sagen, was genau @-Domains sind?
Ein Mythos. Ein Werbetrick. Verarsche. Nenn es wie du willst...

                 -- Alexandra Buss und Björn Höhrmann in dciwam

Reply via email to