From: Eric Covener Date: Wed, 26 Jun 2024 10:27:30 +0000 (+0000) Subject: don't add / to / in the non-perdir X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=62e1ebf538d77ff8dcd1ca830486931f61a6dbaa;p=thirdparty%2Fapache%2Fhttpd.git don't add / to / in the non-perdir git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1918652 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/mappers/mod_rewrite.c b/modules/mappers/mod_rewrite.c index 2e7d18cc605..7c965a2ed4f 100644 --- a/modules/mappers/mod_rewrite.c +++ b/modules/mappers/mod_rewrite.c @@ -4408,17 +4408,13 @@ static rule_return_type apply_rewrite_rule(rewriterule_entry *p, */ if (!is_proxyreq && !is_absolute_path(newuri) + && !AP_IS_SLASH(*newuri) && !is_absolute_uri(newuri, NULL)) { if (ctx->perdir) { - if (!AP_IS_SLASH(*newuri)) { - /* perdir, the newuri will be internally redirected, so - * leading slash is enough even if it's an ambiguous fs path - */ - rewritelog(r, 3, ctx->perdir, "add per-dir prefix: %s -> %s%s", - newuri, ctx->perdir, newuri); + rewritelog(r, 3, ctx->perdir, "add per-dir prefix: %s -> %s%s", + newuri, ctx->perdir, newuri); - newuri = apr_pstrcat(r->pool, ctx->perdir, newuri, NULL); - } + newuri = apr_pstrcat(r->pool, ctx->perdir, newuri, NULL); } else if (!(p->flags & (RULEFLAG_PROXY | RULEFLAG_FORCEREDIRECT))) { /* Not an absolute URI-path and the scheme (if any) is unknown,