,

How to allow special characters in URL or query string

I am using asp.net 4.0 with Sql server. I have an requirement to pass special characters in URL query string.

for example my URL need to be like http://mysite.com/default.aspx?a=xyx(abc)
In the above URL my special character is "(" and ")". While development I have not faced any issue but as I uploaded the files to serve it start giving error 404 (page not found) where ever I have use "(" or ")" special characters.

When I started searching I have tried many solutions. but nothing works for me.
Then on some site some one has sugested to check IIS log.

When I checked the log I found that I have Installed Microsoft URL Scan 3.1 on my server which is filtering the URL.

So, I need to allow "(" and ")" on my server so, I decided to allow there characters in my URL.

So, to add exception to URL Scan 3.1 you need to open urlscan.ini which you can find in "%windir%\system32\inetsrv\urlscan\"

You can use 2 sections to allow special characters
1) DenyQueryStringSequences
2) AlwaysAllowedUrls


DenyQueryStringSequences - In this section you can add and remove the allowed characters but this will allow for all the URLs.

AlwaysAllowedUrls - In this you can define a single URL like "/default.aspx".So, the special characters will be allowed to only single URL not to all the URL of the IIS sites

Share:

3 comments:

SMS Computer Solutions said...

Brilliant post! A URL is a type of Uniform Resource Identifier or also called URI. In many technical documents and verbal discussions URL is often used as a synonym for URI.

IT Solutions said...

Thanks a lot for a bunch of good tips. I look forward to reading more on the topic in the future. Keep up the good work! This blog is going to be great resource. Love reading it.

Great Solution!

Unknown said...

Useful information thanx for sharing...
QuickBooks Intuit Number In Usa