https://bz.apache.org/bugzilla/show_bug.cgi?id=69239

            Bug ID: 69239
           Summary: I need the result of a map lookup without having the
                    root-prefix added
           Product: Apache httpd-2
           Version: 2.4.61
          Hardware: PC
                OS: Mac OS X 10.1
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_rewrite
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

In change 9494aa8 the following code was added:
        }
        else if (!(p->flags & (RULEFLAG_PROXY | RULEFLAG_FORCEREDIRECT))) {
            /* Not an absolute URI-path and the scheme (if any) is unknown,
             * and it won't be passed to fully_qualify_uri() below either,
             * so add an implicit '/' prefix. This avoids potentially a common
             * rule like "RewriteRule ^/some/path(.*) $1" that is given a path
             * like "/some/pathscheme:..." to produce the fully qualified URL
             * "scheme:..." which could be misinterpreted later.
             */
            rewritelog(r, 3, ctx->perdir, "add root prefix: %s -> /%s",
                       newuri, newuri);

            newuri = apr_pstrcat(r->pool, "/", newuri, NULL);
        }

I have rules that look up a map and based on the key a path is generated. But
since the look up result isn't an absolute URI-path and does not have a scheme,
the root-prefix gets added.
The rule looks like this:
RewriteRule ^ ${redir-map:${tolower-map:%{HTTP_HOST}}}

and the lookup results in a user-name on that system.
Later rules will construct a URL which needs that user-name but with the added
/ the further rules break.

It would be great, if there would be any way to be able no not have this
behavior interfer. Maybe a flag that can be set, so that the root prefix won't
be added.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to