https://bz.apache.org/bugzilla/show_bug.cgi?id=63262
Bug ID: 63262
Summary: RewriteRule in <If> section matches against file
system path instead of URI path
Product: Apache httpd-2
Version: 2.4.38
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P2
Component: mod_rewrite
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
When using RewriteRule in <If> context, the pattern is matched against the file
system path instead of the URI path:
httpd.conf:
<IfModule rewrite_module>
RewriteEngine on
LogLevel alert rewrite:trace8
<If "true">
RewriteRule ^(.*)$ http://example.localhost/?$1 [R=302,L]
</If>
</IfModule>
Request: http://example.com/test
Expected response: Redirect to http://example.localhost/?/test
Received response: Redirect to http://example.localhost/?/usr/www/htdocs/test
Rewrite log:
[Fri Mar 15 10:52:15.994467 2019] [mpm_winnt:notice] [pid 4976:tid 408]
AH00455: Apache/2.4.38 (Win64) OpenSSL/1.0.2r configured -- resuming normal
operations
[Fri Mar 15 10:52:26.369060 2019] [rewrite:trace2] [pid 10744:tid 1128]
mod_rewrite.c(483): [client 127.0.0.1:62192] 127.0.0.1 - -
[localhost/sid#1d7798][rid#290ff40/initial] init rewrite engine with requested
uri /test
[Fri Mar 15 10:52:26.369060 2019] [rewrite:trace1] [pid 10744:tid 1128]
mod_rewrite.c(483): [client 127.0.0.1:62192] 127.0.0.1 - -
[localhost/sid#1d7798][rid#290ff40/initial] pass through /test
[Fri Mar 15 10:52:26.377060 2019] [rewrite:trace3] [pid 10744:tid 1128]
mod_rewrite.c(483): [client 127.0.0.1:62192] 127.0.0.1 - -
[localhost/sid#1d7798][rid#290ff40/initial] [perdir *If/] applying pattern
'^(.*)$' to uri '/usr/www/htdocs/test'
[Fri Mar 15 10:52:26.377060 2019] [rewrite:trace2] [pid 10744:tid 1128]
mod_rewrite.c(483): [client 127.0.0.1:62192] 127.0.0.1 - -
[localhost/sid#1d7798][rid#290ff40/initial] [perdir *If/] rewrite
'/usr/www/htdocs/test' -> 'http://example.localhost/?/usr/www/htdocs/test'
--
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]