Solved

Problem with apache rewrite and spaces

Posted on 2009-07-11
2
444 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

860 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