# Apache + mongrel cluster: early unescaping of URI by Apache

**URL:** <https://www.ruby-forum.com/t/apache-mongrel-cluster-early-unescaping-of-uri-by-apache/130831>\
**Category:** Rails\
**Created:** [March 3, 2008, 7:15pm UTC](https://www.ruby-forum.com/t/apache-mongrel-cluster-early-unescaping-of-uri-by-apache/130831 "2008-03-03T19:15:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yuleven](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/c89c15/32.png) [@yuleven](https://www.ruby-forum.com/u/yuleven)\
**Post date:** [March 3, 2008, 7:15pm UTC](https://www.ruby-forum.com/t/apache-mongrel-cluster-early-unescaping-of-uri-by-apache/130831/1 "2008-03-03T19:15:08Z")

</div>

Hello all,

I have run into a weird problem.

I have the following route:

map.show\_wiki\_page ‘wiki/show/:name/:version’, :action =\> ‘show’ ,  
:version  
=\> nil, :requirements =\> {:version =\> /\d+/, :name =\> /[\d  
\w?!,()[]]+/}

If I run a bare mongrel (my dev environment) and access my app with  
[http://myhost/wiki/show/Waarom+deze+wiki+%3F%3F](http://myhost/wiki/show/Waarom+deze+wiki+%3F%3F),  
my params are {“name”=\>“Waarom deze wiki ??”, “action”=\>“show”,  
“controller”=\>“wiki”}, which is exactly what I expect, but  
in my production environment (apache 2.2.3 + mod\_proxy + mongrel  
cluster) my  
params hash is  
{“name”=\>"Waarom deze wiki ", “action”=\>“show”, “controller”=\>“wiki”,  
“?”=\>nil} which is incorrect.

Looking into request headers here’s what I have found out:

Bare mongrel:

“REQUEST\_URI” =\>“/wiki/show/Waarom+deze+wiki+%3F%3F”  
“PATH\_INFO” =\>“/wiki/show/Waarom+deze+wiki+%3F%3F”  
“REQUEST\_PATH” =\>“/wiki/show/Waarom+deze+wiki+%3F%3F”

Apache + mongrel cluster:

“REQUEST\_URI” =\> “/wiki/show/Waarom+deze+wiki+??”  
“PATH\_INFO” =\> “/wiki/show/Waarom+deze+wiki+”  
“REQUEST\_PATH” =\> “/wiki/show/Waarom+deze+wiki+”

Looking at REQUEST\_URI of the production environment I am wondering why  
Apache unescaped the URI before sending  
it to mongrels.

The rewriting rule is standard and used by other similar setups, as far  
as I  
know:

# Redirect all non-static requests to cluster

RewriteCond %{DOCUMENT\_ROOT}/%{REQUEST\_FILENAME} !-f  
RewriteRule ^/(.\*)$ balancer://portal\_cluster%{REQUEST\_URI} [P,QSA,L]

Does anyone have similar experience? Where should I be looking to change  
this behavior?

Thank you!

Production box: Debian stable  
Mongrel 1.1.1  
Rails 1.2.5  
apache 2.2.3

Best regards,  
Yuri L.

---

<div class="post-metadata">

**Author:** ![yuleven](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/c89c15/32.png) [@yuleven](https://www.ruby-forum.com/u/yuleven)\
**Post date:** [March 14, 2008, 1:08am UTC](https://www.ruby-forum.com/t/apache-mongrel-cluster-early-unescaping-of-uri-by-apache/130831/2 "2008-03-14T01:08:59Z")

</div>

hi yuri!

Yuri L. [2008-03-03 16:31]:

> Does anyone have similar experience? Where should I be looking to  
> change this behavior?  
> we had a similar issue which i gladly solved today. here’s what i  
> needed to change to make it work:  
> [http://prometheus.khi.uni-koeln.de/trac/pandora/changeset/555](http://prometheus.khi.uni-koeln.de/trac/pandora/changeset/555)

see the references there for more information; particularly,  
[https://issues.apache.org/bugzilla/show\_bug.cgi?id=34602#c16](https://issues.apache.org/bugzilla/show_bug.cgi?id=34602#c16).

hope that helps with your problem, too 😉

cheers  
jens

–  
Jens W., Dipl.-Bibl. (FH)  
prometheus - Das verteilte digitale Bildarchiv für Forschung & Lehre  
Kunsthistorisches Institut der Universität zu  
KölnAlbertus-Magnus-Platz, D-50923  
KölnTel.: +49 (0)221 470-6668, E-Mail: removed\_email\_address@domain.invalid  
[http://www.prometheus-bildarchiv.de/](http://www.prometheus-bildarchiv.de/)
