You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by co...@apache.org on 2024/06/26 10:27:30 UTC

svn commit: r1918652 - /httpd/httpd/trunk/modules/mappers/mod_rewrite.c

Author: covener
Date: Wed Jun 26 10:27:30 2024
New Revision: 1918652

URL: http://svn.apache.org/viewvc?rev=1918652&view=rev
Log:
don't add / to / in the non-perdir

Modified:
    httpd/httpd/trunk/modules/mappers/mod_rewrite.c

Modified: httpd/httpd/trunk/modules/mappers/mod_rewrite.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/mappers/mod_rewrite.c?rev=1918652&r1=1918651&r2=1918652&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/mappers/mod_rewrite.c (original)
+++ httpd/httpd/trunk/modules/mappers/mod_rewrite.c Wed Jun 26 10:27:30 2024
@@ -4408,17 +4408,13 @@ static rule_return_type apply_rewrite_ru
      */
     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,