Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 84F4B200A01 for ; Tue, 3 May 2016 16:17:27 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 846C11609F4; Tue, 3 May 2016 16:17:27 +0200 (CEST) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id CFEC11609A9 for ; Tue, 3 May 2016 16:17:26 +0200 (CEST) Received: (qmail 66573 invoked by uid 500); 3 May 2016 14:17:25 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 66563 invoked by uid 99); 3 May 2016 14:17:25 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 May 2016 14:17:25 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 01672C04B9 for ; Tue, 3 May 2016 14:17:25 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.703 X-Spam-Level: X-Spam-Status: No, score=-0.703 tagged_above=-999 required=6.31 tests=[RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=disabled Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id CT8aVbVIbsNJ for ; Tue, 3 May 2016 14:17:21 +0000 (UTC) Received: from smtprelay04.ispgateway.de (smtprelay04.ispgateway.de [80.67.31.31]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with ESMTPS id 472B05F4EA for ; Tue, 3 May 2016 14:17:21 +0000 (UTC) Received: from [10.128.8.3] (helo=EXFE03.EXCHANGE.INT) by smtprelay04.ispgateway.de with esmtps (TLSv1.2:AES256-SHA:256) (Exim 4.84) (envelope-from ) id 1axb8V-0006qr-BK for users@httpd.apache.org; Tue, 03 May 2016 16:17:15 +0200 Received: from EXDAG08-1.EXCHANGE.INT (10.128.10.121) by EXDAG08-1.EXCHANGE.INT (10.128.10.121) with Microsoft SMTP Server (TLS) id 15.0.1076.9; Tue, 3 May 2016 16:17:14 +0200 Received: from EXDAG08-1.EXCHANGE.INT ([fe80::5470:c4a9:d4f3:e1ff]) by EXDAG08-1.EXCHANGE.INT ([fe80::5470:c4a9:d4f3:e1ff%12]) with mapi id 15.00.1076.000; Tue, 3 May 2016 16:17:14 +0200 From: Daniel Betz To: "users@httpd.apache.org" Thread-Topic: Problem with mod_rewrite, especially with ap_context_document_root() in apache 2.4.20 Thread-Index: AdGlQ6to9uAar4K6SMagIfE2+bo7Gw== Date: Tue, 3 May 2016 14:17:14 +0000 Message-ID: <0a10748b2d9d4f8c9c39f38a4cad9099@EXDAG08-1.EXCHANGE.INT> Accept-Language: de-DE, en-US Content-Language: de-DE X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [80.67.16.214] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: [users@httpd] Problem with mod_rewrite, especially with ap_context_document_root() in apache 2.4.20 archived-at: Tue, 03 May 2016 14:17:27 -0000 Hello List, i dont know if im right here, or that i should file a bugreport, but i will= post my problem here first. I have an easy rewrite Rule, which rewrites everything to /index.php, when = the filename or directory doesnt exist. RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] Sometimes and really random i become an bad request error 400 back. After debugging a litte bit i found, that there were changes made with the = "context docroot" Here are the rewrite logs from an failed and from an working request: FAILED: rewrite '2014/tree/' -> '/index.php' trying to replace prefix /www/471639_96450/gn2-hosting.de/host260161/host26= 0155/danielbaer.eu/ with / trying to replace context docroot with context prefix internal redirect with index.php [INTERNAL REDIRECT] WORKING: rewrite '2014/tree/' -> '/index.php' trying to replace prefix /www/471639_96450/gn2-hosting.de/host260161/host26= 0155/danielbaer.eu/ with / trying to replace context docroot \xa0/\xde\v\xd8/\xde\v\x901\xde\v with co= ntext prefix internal redirect with /index.php [INTERNAL REDIRECT] It doesnt work, when when ap_context_document_root(r) is empty, but not NUL= L. Sometimes it gives me strange docroot folders back like \xa0/\xde\v\xd8/\xd= e\v\x901\xde\v In 2.4.19 ( i think ) a new option in mod_rewrite was added and i think the= re could be an error there: /* No base URL, or r->filename wasn't still under dconf->direct= ory * or, r->filename wasn't still under the document root. * If there's a context document root AND a context prefix, and * the context document root is a prefix of r->filename, replac= e. * This allows a relative substitution on a path found by mod_u= serdir * or mod_alias without baking in a RewriteBase. */ if (tmpfilename =3D=3D r->filename && !(dconf->options & OPTION_IGNORE_CONTEXT_INFO)) { if ((ccp =3D ap_context_document_root(r)) !=3D NULL) { const char *prefix =3D ap_context_prefix(r); if (prefix !=3D NULL) { rewritelog((r, 2, dconf->directory, "trying to repl= ace " "context docroot %s with context prefix= %s", ccp, prefix)); r->filename =3D subst_prefix_path(r, r->filename, ccp, prefix); } } } After adding "RewriteOptions IgnoreContextInfo" the random errors are gone. So then. The question is: Bug or Feature and should i file this bug somewhe= re ? Greetings, Daniel --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org