Bug 58573

Summary: mod_rewrite adds path info postfix after a substitution occured
Product: Apache httpd-2 Reporter: Jan Mazánek <jan.mazanek>
Component: mod_rewriteAssignee: Apache HTTPD Bugs Mailing List <bugs>
Status: RESOLVED INVALID    
Severity: normal CC: anders, bobsiegen, budzynowski, covener, gormanjz, ian, michael.moench, nikzze, reg
Priority: P2    
Version: 2.4.7   
Target Milestone: ---   
Hardware: Other   
OS: Linux   
Bug Depends on: 38642    
Bug Blocks:    
Attachments: RewriteLog with comments

Description Jan Mazánek 2015-11-02 13:52:00 UTC
Created attachment 33248 [details]
RewriteLog with comments

+++ This bug was initially created as a clone of Bug #38642 +++

Seems to be related to Bug #38642


Testcase:
-> RewriteRules in per-dir context, 
->.htaccess in root of http://test.zemedelskehaly.jan-mazanek/
-> used RewriteRules:

RewriteEngine On
RewriteBase /
RewriteRule ^(.*)$ test/$1
RewriteRule ^(.*)$ http://www.no.cz/phpinfo.php?rewritten=$1 [R=307,L,NE]

Description: Eyery Request should go to http://www.no.cz/phpinfo.php?rewritten=/test/STRING_IN_URI_AFTER_HOST

-> Request: http://test.zemedelskehaly.jan-mazanek/1/2/3
-> http://www.no.cz/phpinfo.php?rewritten=test/1/2/3/ - expected result
-> http://www.no.cz/phpinfo.php?rewritten=test/1/2/3/2/3 - real result

Problem is with "add path info postfix", see attached Rewritelog
Comment 1 Eric Covener 2015-11-02 13:54:41 UTC
mod_rewrite doesn't know what you want to do with PATH_INFO, and defaults to restoring it.  The flag in the closed bug you marked as a blocker is how you instruct it to not restore it.
Comment 2 Jan Mazánek 2015-11-02 14:27:55 UTC
Eric Covener, thank You for directing to DPI flag.

I previously hotfixed this with flag L, but DPI is better.