‘Mozilla Developer Network’ Archives
Avoiding Catastrophic Backtracking in Apache RewriteRule Patterns
In the 0.9.2 release of MDN, we are going to fix some integration issues between Django, Deki, and phpBB using Apache mod_rewrite. A horrible thought occurred to me... What if one of our RewriteRule directives was written in a way that would cause catastrophic backtracking? Ouch. This could lead to slow performance or no page rendering. Symptoms may include hours of headdesking and painful mod_rewrite debugging. What is Catastrophic Backtracking? Regular expression engines work by walking through a string trying to match a pattern. They may backtrack when they test the next character and the pattern doesn't match, but ... Read More »
