Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 450
  • Last Modified:

Problem with apache rewrite and spaces

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
soyglobal
Asked:
soyglobal
1 Solution
 
ahoffmannCommented:
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
 
ravenplCommented:
use build-in escaping function

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

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now