Solved

Problem with apache rewrite and spaces

Posted on 2009-07-11
2
439 Views
Last Modified: 2012-08-13
Hi, i have apache as frontend of my webapp, them i have some rewrite rules, but when the querystring result has spaces apache send via proxy the querystring without escape the space char as you can see down.
How i can do for when i apply the rule replace the spaces char in querystring
Thanks
RewriteRule ^(.*)\.pro $1.pro?ip=%{HTTP:X-FORWARDED-FOR} [QSA,L] 
 

Result:

go-ahead with proxy request proxy:http://192.168.2.52:81/cgi-vel/conline/rqmvdirecto.pro?ip=169.158.225.2, 169.158.84.254 [OK]

Open in new window

0
Comment
Question by:soyglobal
2 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 24833409
there're no spaces allowed anywhere in the URL, you have to use proper encing for them
%20 anywhere or alternatively + in the search parameter
0
 
LVL 43

Accepted Solution

by:
ravenpl earned 500 total points
ID: 24833504
use build-in escaping function

RewriteRule ^(.*)\.pro $1.pro?ip=${escape:%{HTTP:X-FORWARDED-FOR}} [QSA,L]
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Foreword In the years since this article was written, numerous hacking attacks have targeted password-protected web sites.  The storage of client passwords has become a subject of much discussion, some of it useful and some of it misguided.  Of cou…
Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now