views:

35

answers:

1

My web-site is working under ASP.NET 3.5, IIS7, Integrated pipiline mode. My HttpModule is getting request to all resources, including URLs like this: http://my-site.com/address

And I would support '*' symbol in the URL for users. All attempts to navigate to such address are blocked by ASP.NET with the following error message:

HTTP Error 400.0 - Bad Request ASP.NET detected invalid characters in the URL.

In this case execution doesn't reach to the 'BeginRequest' handler.

Is there any posibility to get ability to process URLs with '*' symbol (and other reserved too if possible).

Thanks

A: 

What is the purpose of having a * in the URL, you may be able to disable some URL filtering setting to allow this but this will impact the security of your site. Take a look at the following if you really need to do this:

http://dirk.net/2008/06/09/ampersand-the-request-url-in-iis7/ http://support.microsoft.com/kb/820129 http://www.lostechies.com/blogs/joshuaflanagan/archive/2009/04/27/asp-net-400-bad-request-with-restricted-characters.aspx

An HttpModule which is properly coded and registered in web.config will automatically receive any request which ASP.Net starts to process, if ASP.Net rejects the request prior to starting processing then the BeginRequest method will never get called.

Depending on what you are trying to do it may be better to create a HttpHandler and register it with a wildcard path instead.

RobV
Both links 1st and 2nd suppose to update registry settings (that is not appropriate for me as my web-site is hosted by big company that certainly won't change thier registry for me).The 3rd contains link to explanation why that is not possible (that is your 1st link :) ) and suggests to put such symbols after '?'.Neither one of those is ok for me. So I guess that there are no other way to implement my request.I guest that I should change my logic and live without '*' in URL... :(If there are any other ideas - anybody is welcome!RobV, anyway, thank you for answer.
Budda