mod_rewrite with percent encoded slashes...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

	I'm encountering an oddity that I can't currently explain.  Hopefully
someone here will know the answer.

I'm trying to improve some URLs and am using the following mod_rewrite
configuration:

 RewriteEngine On
 RewriteRule ^/test!(.*)$ /test.php?a=$1 [PT,L,QSA]

So the following URLs get successfully passed through to test.php:

http://server.domain.co.uk/test!abcd
http://server.domain.co.uk/test!abcd/efgh
http://server.domain.co.uk/test!abcd%20efgh

but the following one does not make it:

http://server.domain.co.uk/test!abcd%2Fefgh

In fact it doesn't even hit mod_rewrite!  I've added RewriteLog and
ewriteLogLevel but nothing's written to the log whereas the other three
URLs result in something like the following in the log file (so I know
the log directives are working):

172.16.0.1 - - [27/Nov/2007:16:06:34 +0000]
[server.domain.co.uk/sid#b820e3f0][rid#b8673b78/initial] (2) init
rewrite engine with requested uri /test!abcd
172.16.0.1 - - [27/Nov/2007:16:06:34 +0000]
[server.domain.co.uk/sid#b820e3f0][rid#b8673b78/initial] (3) applying
pattern '^/test!(.*)' to uri '/test!abcd'
172.16.0.1 - - [27/Nov/2007:16:06:34 +0000]
[server.domain.co.uk/sid#b820e3f0][rid#b8673b78/initial] (2) rewrite
'/test!abcd' -> '/test.php?a=abcd'
172.16.0.1 - - [27/Nov/2007:16:06:34 +0000]
[server.domain.co.uk/sid#b820e3f0][rid#b8673b78/initial] (3) split
uri=/test.php?a=abcd -> uri=/test.php, args=a=abcd
172.16.0.1 - - [27/Nov/2007:16:06:34 +0000]
[server.domain.co.uk/sid#b820e3f0][rid#b8673b78/initial] (2) forcing
'/test.php' to get passed through to next API URI-to-filename handler


Does anyone have any suggestion why a slash that's been converted to %2F
causes the request to miss mod_rewrite (and come back with a 404)?

Many thanks in advance,


				Neil.

-- 
Neil Hillard                    neil.hillard@xxxxxxxxxxxxxxxxxx
AgustaWestland                  http://www.whl.co.uk/

Disclaimer: This message does not necessarily reflect the
            views of Westland Helicopters Ltd.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux