httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 45529] B flag in mod_rewrite RewriteRule doesn't escape & and other sim characters
Date Fri, 15 Aug 2008 22:59:07 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=45529


Markus Stockhausen <markus.stockhausen@collogia.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |ASSIGNED




--- Comment #3 from Markus Stockhausen <markus.stockhausen@collogia.de>  2008-08-15
15:59:06 PST ---
Hello,

here are the results from an test with the following settings:

RewriteEngine on
RewriteRule ^/rewrite_from/(.*) /rewrite_to/$1 [B,L]
RewriteLog /var/log/apache/rewrite.log
RewriteLogLevel 6

First test where everything works correctly. Requested URL is
http://www.myserver.com/rewrite_from/a%23b

192.168.2.203 - - [16/Aug/2008:00:48:17 +0200]
[www.myserver.com/sid#80aafa0][rid#828f000/initial] (2) init rewrite engine
with requested uri /rewrite_from/a#b
192.168.2.203 - - [16/Aug/2008:00:48:17 +0200]
[www.myserver.com/sid#80aafa0][rid#828f000/initial] (3) applying pattern
'^/rewrite_from/(.*)' to uri '/rewrite_from/a#b'
192.168.2.203 - - [16/Aug/2008:00:48:17 +0200]
[www.myserver.com/sid#80aafa0][rid#828f000/initial] (5) escaping backreference
'a#b' to 'a%23b'
192.168.2.203 - - [16/Aug/2008:00:48:17 +0200]
[www.myserver.com/sid#80aafa0][rid#828f000/initial] (2) rewrite
'/rewrite_from/a#b' -> '/rewrite_to/a%23b'
192.168.2.203 - - [16/Aug/2008:00:48:17 +0200]
[www.myserver.com/sid#80aafa0][rid#828f000/initial] (2) local path result:
/rewrite_to/a%23b
192.168.2.203 - - [16/Aug/2008:00:48:17 +0200]
[www.myserver.com/sid#80aafa0][rid#828f000/initial] (2) prefixed with
document_root to /mnt/www/html/rewrite_to/a%23b
192.168.2.203 - - [16/Aug/2008:00:48:17 +0200]
[www.myserver.com/sid#80aafa0][rid#828f000/initial] (1) go-ahead with
/mnt/www/html/rewrite_to/a%23b [OK]
192.168.2.203 - - [16/Aug/2008:00:48:17 +0200]
[www.myserver.com/sid#80aafa0][rid#828f000/initial] (3) [perdir /mnt/www/html/]
add path info postfix: /mnt/www/html/rewrite_to ->
/mnt/www/html/rewrite_to/a%23b
192.168.2.203 - - [16/Aug/2008:00:48:17 +0200]
[www.myserver.com/sid#80aafa0][rid#828f000/initial] (3) [perdir /mnt/www/html/]
strip per-dir prefix: /mnt/www/html/rewrite_to/a%23b -> rewrite_to/a%23b
192.168.2.203 - - [16/Aug/2008:00:48:17 +0200]
[www.myserver.com/sid#80aafa0][rid#828f000/initial] (3) [perdir /mnt/www/html/]
applying pattern '^(.*)$' to uri 'rewrite_to/a%23b'
192.168.2.203 - - [16/Aug/2008:00:48:17 +0200]
[www.myserver.com/sid#80aafa0][rid#828f000/initial] (4) [perdir /mnt/www/html/]
RewriteCond: input='' pattern='mosConfig_[a-zA-Z_]{1,21}(=|\%3D)' =>
not-matched
192.168.2.203 - - [16/Aug/2008:00:48:17 +0200]
[www.myserver.com/sid#80aafa0][rid#828f000/initial] (4) [perdir /mnt/www/html/]
RewriteCond: input='' pattern='base64_encode.*\(.*\)' => not-matched
192.168.2.203 - - [16/Aug/2008:00:48:17 +0200]
[www.myserver.com/sid#80aafa0][rid#828f000/initial] (4) [perdir /mnt/www/html/]
RewriteCond: input='' pattern='(\<|%3C).*script.*(\>|%3E)' [NC] => not-matched
192.168.2.203 - - [16/Aug/2008:00:48:17 +0200]
[www.myserver.com/sid#80aafa0][rid#828f000/initial] (4) [perdir /mnt/www/html/]
RewriteCond: input='' pattern='GLOBALS(=|\[|\%[0-9A-Z]{0,2})' => not-matched
192.168.2.203 - - [16/Aug/2008:00:48:17 +0200]
[www.myserver.com/sid#80aafa0][rid#828f000/initial] (4) [perdir /mnt/www/html/]
RewriteCond: input='' pattern='_REQUEST(=|\[|\%[0-9A-Z]{0,2})' => not-matched
192.168.2.203 - - [16/Aug/2008:00:48:17 +0200]
[www.myserver.com/sid#80aafa0][rid#828f000/initial] (3) [perdir /mnt/www/html/]
add path info postfix: /mnt/www/html/rewrite_to ->
/mnt/www/html/rewrite_to/a%23b
192.168.2.203 - - [16/Aug/2008:00:48:17 +0200]
[www.myserver.com/sid#80aafa0][rid#828f000/initial] (3) [perdir /mnt/www/html/]
strip per-dir prefix: /mnt/www/html/rewrite_to/a%23b -> rewrite_to/a%23b
192.168.2.203 - - [16/Aug/2008:00:48:17 +0200]
[www.myserver.com/sid#80aafa0][rid#828f000/initial] (3) [perdir /mnt/www/html/]
applying pattern '(.*)' to uri 'rewrite_to/a%23b'

Second test where everything goes wrong. Requested URL is
http://www.myserver.com/rewrite_from/a%26b

192.168.2.203 - - [16/Aug/2008:00:49:26 +0200]
[www.myserver.com/sid#80aafa0][rid#828f000/initial] (2) init rewrite engine
with requested uri /rewrite_from/a&b
192.168.2.203 - - [16/Aug/2008:00:49:26 +0200]
[www.myserver.com/sid#80aafa0][rid#828f000/initial] (3) applying pattern
'^/rewrite_from/(.*)' to uri '/rewrite_from/a&b'
192.168.2.203 - - [16/Aug/2008:00:49:26 +0200]
[www.myserver.com/sid#80aafa0][rid#828f000/initial] (5) escaping backreference
'a&b' to 'a&b'
192.168.2.203 - - [16/Aug/2008:00:49:26 +0200]
[www.myserver.com/sid#80aafa0][rid#828f000/initial] (2) rewrite
'/rewrite_from/a&b' -> '/rewrite_to/a&b'
192.168.2.203 - - [16/Aug/2008:00:49:26 +0200]
[www.myserver.com/sid#80aafa0][rid#828f000/initial] (2) local path result:
/rewrite_to/a&b
192.168.2.203 - - [16/Aug/2008:00:49:26 +0200]
[www.myserver.com/sid#80aafa0][rid#828f000/initial] (2) prefixed with
document_root to /mnt/www/html/rewrite_to/a&b
192.168.2.203 - - [16/Aug/2008:00:49:26 +0200]
[www.myserver.com/sid#80aafa0][rid#828f000/initial] (1) go-ahead with
/mnt/www/html/rewrite_to/a&b [OK]
192.168.2.203 - - [16/Aug/2008:00:49:26 +0200]
[www.myserver.com/sid#80aafa0][rid#828f000/initial] (3) [perdir /mnt/www/html/]
add path info postfix: /mnt/www/html/rewrite_to -> /mnt/www/html/rewrite_to/a&b
192.168.2.203 - - [16/Aug/2008:00:49:26 +0200]
[www.myserver.com/sid#80aafa0][rid#828f000/initial] (3) [perdir /mnt/www/html/]
strip per-dir prefix: /mnt/www/html/rewrite_to/a&b -> rewrite_to/a&b
192.168.2.203 - - [16/Aug/2008:00:49:26 +0200]
[www.myserver.com/sid#80aafa0][rid#828f000/initial] (3) [perdir /mnt/www/html/]
applying pattern '^(.*)$' to uri 'rewrite_to/a&b'
192.168.2.203 - - [16/Aug/2008:00:49:26 +0200]
[www.myserver.com/sid#80aafa0][rid#828f000/initial] (4) [perdir /mnt/www/html/]
RewriteCond: input='' pattern='mosConfig_[a-zA-Z_]{1,21}(=|\%3D)' =>
not-matched
192.168.2.203 - - [16/Aug/2008:00:49:26 +0200]
[www.myserver.com/sid#80aafa0][rid#828f000/initial] (4) [perdir /mnt/www/html/]
RewriteCond: input='' pattern='base64_encode.*\(.*\)' => not-matched
192.168.2.203 - - [16/Aug/2008:00:49:26 +0200]
[www.myserver.com/sid#80aafa0][rid#828f000/initial] (4) [perdir /mnt/www/html/]
RewriteCond: input='' pattern='(\<|%3C).*script.*(\>|%3E)' [NC] => not-matched
192.168.2.203 - - [16/Aug/2008:00:49:26 +0200]
[www.myserver.com/sid#80aafa0][rid#828f000/initial] (4) [perdir /mnt/www/html/]
RewriteCond: input='' pattern='GLOBALS(=|\[|\%[0-9A-Z]{0,2})' => not-matched
192.168.2.203 - - [16/Aug/2008:00:49:26 +0200]
[www.myserver.com/sid#80aafa0][rid#828f000/initial] (4) [perdir /mnt/www/html/]
RewriteCond: input='' pattern='_REQUEST(=|\[|\%[0-9A-Z]{0,2})' => not-matched
192.168.2.203 - - [16/Aug/2008:00:49:26 +0200]
[www.myserver.com/sid#80aafa0][rid#828f000/initial] (3) [perdir /mnt/www/html/]
add path info postfix: /mnt/www/html/rewrite_to -> /mnt/www/html/rewrite_to/a&b
192.168.2.203 - - [16/Aug/2008:00:49:26 +0200]
[www.myserver.com/sid#80aafa0][rid#828f000/initial] (3) [perdir /mnt/www/html/]
strip per-dir prefix: /mnt/www/html/rewrite_to/a&b -> rewrite_to/a&b
192.168.2.203 - - [16/Aug/2008:00:49:26 +0200]
[www.myserver.com/sid#80aafa0][rid#828f000/initial] (3) [perdir /mnt/www/html/]
applying pattern '(.*)' to uri 'rewrite_to/a&b'

I hope I got the correct lines from the debug output as I have further rewrite
rules in my .htaccess files.

Best regards.

Markus


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Mime
View raw message