You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Gordon Anderson <go...@3months.com> on 2004/04/22 03:02:22 UTC

[users@httpd] Encoding URLs when proxying using mod_rewrite

Hi everyone,

I'm stuck on an annoying problem with mod_rewrite and wondered if anyone can
help.  We are using Apache as a front end to Cocoon (another Apache project)
- static files such as images and CSS are served by Apache, dynamic pages by
Cocoon.



One of our URLs that requires to be processed by Cocoon is of a form that
may contain spaces.

e.g.

http://127.0.0.1/r/Vacancies/Staff%20Vacancies.htm

Apache appears to be rewriting this in a form to send to Cocoon as

http://127.0.0.1/r/Vacancies/Staff Vacancies.htm

which fails.


To confirm this I tried encoding the % sign to %25 in the original URL, i.e.

http://127.0.0.1/r/Vacancies/Staff%2520Vacancies.htm

This is passed on by mod_rewrite as the correct URL
http://127.0.0.1/r/Vacancies/Staff%20Vacancies.htm

to Cocoon.




Is there anyway to prevent Apache mod_rewrite decoding the URL before
proxying it on to Cocoon.


The rewrite rule is as follows:


RewriteRule !(\.gif|\.php|\.jpg|\.jpeg|\.jpe|\.js|\.css)
http://127.0.0.1:8080%{REQUEST_URI} [P]

in the Apache configuration file.  Cocoon is running on port 8080 in the
above example.



Regards,
Gordon


Gordon Anderson
3months.com





---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org