-3

Get the error 403 Forbidden when I trying to use an encoded URL, for example, the original URL and working is

http://myip.com/mypgm.pgm?USR=name&CTA=6822&VAL=1

but when I use

http://myip.com/mypgm.pgm%3FUSR%3Dname%26CTA%3D6822%26VAL%3D1

I get the error, how can I allow the execution of an encoded URL in my httpd.conf? I am not using any mod_security.

I have to send the URL as parameter, that's why I am testing the URL in this way. I'm working over AS400.

  • only encode the data, not the ? and & symbols and the field names in the string. I bet your encoding the entire query string... that's incorrect. Encode each piece of data before building your query string. /cgi-bin/mypgm?field1=&field2= – bvstone Apr 04 '16 at 22:33

1 Answers1

1

If the URL is sent encoded to a page as an URL-parameter (i.e. "http://some.url/?url=yourencodedurl"), you could decode the parameter (see here for one way to get the argument) in the some.url page and then invoke after using decodeURIComponent():

window.location = decodeURIComponent(argUrl); // get argUrl first as string

This:

http://myip.com/mypgm.pgm%3FUSR%3Dname%26CTA%3D6822%26VAL%3D1

would then become

decodeURIComponent("http://myip.com/mypgm.pgm%3FUSR%3Dname%26CTA%3D6822%26VAL%3D1"):

"http://myip.com/mypgm.pgm?USR=name&CTA=6822&VAL=1"

Community
  • 1
  • 1