Bug 41423 - mod_rewrite corrupts rewritten URL while starting to process next rule in ruleset
Summary: mod_rewrite corrupts rewritten URL while starting to process next rule in rul...
Status: RESOLVED DUPLICATE of bug 38642
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_rewrite (show other bugs)
Version: 2.2.3
Hardware: PC FreeBSD
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-20 00:43 UTC by nikzze
Modified: 2007-01-20 07:29 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nikzze 2007-01-20 00:43:38 UTC
Hi, it seems like I've found a bug in mod_rewrite's behavior (per-dir).

Ruleset in .htaccess:

rewriteengine on
rewriterule ^(.*)$ $1
rewriterule ^(.*)$ redir.html?$1 [L]

From rewrite_log:

rewrite 'abc/def' -> 'abc/def'
rewrite 'abc/def/def' -> 'redir.html?abc/def/def'

As shown above - mod_rewrite has corrupted URL (rewritten by 1st rule) by adding
unexpected '/def' to it. It happens almost in every case when a request
('abc/def' in example above) is big enough (contains more than one or two
directories).

I've tested it with Apache 2.2.3 (FreeBSD) and Apache 2.0.59 (Windows XP).
What's the reason of this behavior and are there any workarounds?
Comment 1 Bob Ionescu 2007-01-20 07:29:44 UTC

*** This bug has been marked as a duplicate of 38642 ***