httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject [users@httpd] mod_rewrite decodes %20 -> 400 bad request
Date Sat, 12 Nov 2005 19:33:51 GMT

I'm using mod_rewrite with httpd 1.3.34 and am having some difficulties
with it when the URL that is getting rewritten has spaces (encoded as
%20) in it.  Example:

The error I get is "400 bad Request":

Bad Request
Your browser sent a request that this server could not understand.
The request line contained invalid characters following the protocol

My rewrite rule looks like this:

RewriteRule    ^/user/(.*)/search/(.*)$   
/simpy/$1&q=$2 [P,NE]

And what I see in my access_log is:
  ... "GET /simpy/ bar HTTP/1.1" ...

The problem seems to be that space in "foo bar".
I believe I need to tell httpd/rewrite module _not_ to decode the %20
from the original URL.

Does anyone know how I could configure mod_rewrite so that the %20 gets
preserved instead of converted to spaces?

Any help would be greatly appreciated.  I just discovered this problem
on production site.


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message