1

I have the following proxy rule on www.example.com/.htaccess

RewriteEngine On
RewriteRule ^(.*)$ http://www2.example.com/$1 [P]

Requests for

http://www.example.com/images/properties/resized%20pics/1_thumb.jpg

Are showing up in the server logs on www2 as

/images/properties/resized

I've tried various flags [NE,P], [B,P] but can't get this to work. Also tried quoting the second argument of RewriteRule. I've seen this question but it deals with 500 I'm getting 404.

Apache 500 when proxying URLS with %20 via mod_proxy

tcpdump -A -s 0 port 80 and host www2.example.com | grep resized
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
E...%.@.t...I...l.s....Pu....<6.P.@).f..GET /images/properties/resized/ HTTP/1.1
Dustin Butler
  • 113
  • 1
  • 5
  • 1
    I have tried your config and it does work for me as is (it sends `%20` to final server). As it is on 80 port, I'd suggest doing a `tcpdump -A -s 0 port 80 and host www2.example.com` to check if it is sending the correct petition and that it is not a log problem on www2. – NuTTyX Oct 03 '14 at 14:51
  • I just noticed this is on Apache 2.2.9, could be the reason. That is debian Lenny for those keeping track, at least it's not Etch. – Dustin Butler Oct 03 '14 at 17:38
  • Added tcpdump info to the question. I think it's this bug but can't tell which version it's fixed in https://issues.apache.org/bugzilla/show_bug.cgi?id=46428 – Dustin Butler Oct 03 '14 at 18:46
  • Seems to be patched on `Apache 2.2.12`. – NuTTyX Oct 03 '14 at 20:00
  • That's what I thought but I upgraded to 2.2.16-6+squeeze4~bpo50+1 from backports and still broke. Frustrating.. – Dustin Butler Oct 03 '14 at 20:30
  • Is it possible to move that config into apache's `.conf` files instead of `.htaccess`? – NuTTyX Oct 03 '14 at 21:50

0 Answers0