Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to handle all HTTP errors to my custom error pages, but I find that when there is a < at the end of url.
Example: http://localhost/<
Response is: Bad Request - Invalid URL HTTP Error 400. The request URL is invalid.

I want to return specific error message in this scenario.
Can anyone tell how to fix this.

Thanking You all in advance

What I have tried:

I tried to search in google not able to find the correct solution for this
Posted
Updated 18-May-16 3:18am

1 solution

Probably because there isn't a solution. Those requests are blocked at the kernel level, before the request even reaches IIS:
Properly handle IIS request with percent sign in url (/%)[^]
How IIS blocks characters in URLs[^]
Use of special characters like '%' '.' and ':' in an IIS URL[^]

You might be able to get the request through to IIS by changing the registry, but this will leave your server more vulnerable to attack:
Experiments in Wackiness: Allowing percents, angle-brackets, and other naughty things in the ASP.NET/IIS Request URL - Scott Hanselman[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900