• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1288
  • Last Modified:

Error 400 - Ampersand (&) on URL parameter value in iis 7.5

Could not find the right solution during my web search so I am going to ask this question.

I have a url like this

http://blahsub.blahdomain.com/blahsite/blahservice.svc/blahhandler?param=12345&msg=value%26more+value

My problem is that when there is a request and the "msg" has a value with an ampersand(%26) it turns the rest of the url into part of another parameter like so:

 msg=value&more+value

and returning  error 400 as a bad request.

I have the URL Rewrite module installed.

How can I allow ampersands in parameter values?

There are plenty of articles online but the ones that I have looked at has not given me the solution that I need.  

I need to use the URL Rewrite in IIS to do this.

add a rule?

thanks for your help.
0
jonjojr
Asked:
jonjojr
  • 3
  • 3
1 Solution
 
becraigCommented:
You might want to switch on verification compatibility:
http://adorr.net/2010/01/configure-iis-to-accept-url-with-special-characters.html
0
 
jonjojrAuthor Commented:
is there another solution if the server does not have Service Pack 1 on .Net 1.1?
0
 
becraigCommented:
If you look at the first solution it allows restricted chars:
through setting,
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\HTTP\Parameters
AllowRestrictedChars

To the best of my knowledge there is no SP restriction on this approach.

Just curious though, why would you not have the later .net frameworks and applicable SPs  ?

There is backward compatibility and most .net FWs can exist together.
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

 
jonjojrAuthor Commented:
I was not expecting an answer so quickly, let me try this on the servers tomorrow morning and give feedback.
0
 
becraigCommented:
If you have any issues with the suggested approach, let me know so we can take another look.
0
 
jonjojrAuthor Commented:
Your solution worked. It is an old legacy system that it just works. So we don't touch it. Thank you for the answer.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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