locked
How to disable file checking on the server? RRS feed

  • Question

  • User1779468316 posted

    Okay, I have a httpModule that takes a url like http://www.my-msi.net/Admin and translates it to http://www.my-msi.net/Default.aspx by converting the member name, Admin, to a number and then storing that number in a cookie on the ressponse stream.

    Everything works as it should in development, but on the production server, it returns a page doesn't exist error before my httpHandler gets control.

    I know that the handler is working because I have a method tied to app.EndRequest that just puts a tag line on every page on the site and that works just fine.

    Also, for .aspx and .jpg files the method handling app.BeginRequest simply returns without doing anything, but this seems to be causing a page error to be reported to the end user. This is something the I'd really like to get fixed. The code to skip these two file types is:

    HttpApplication app = (HttpApplication) source;
    HttpContext ctx = app.Context;
    string url = ctx.Request.RawUrl;
    if ( url.Contains( ".aspx" ) || url.EndsWith( ".jpg" ) )
       return;

    So my two questions are:

    How to disable file existance checking on the server?

    - and -

    What is the minimum amount of work that an HttpHandler is expected to accomplish?

    Eric

    http://www.my-msi.net

     

    Friday, May 29, 2009 9:43 PM

All replies

  • User25861903 posted


     File existance checking can not be disabled . The problem is due to iis configuration . 

    You have to write few configuration lines  in web.config to manage this . 

    Http handlers works  if your web.config can call it properly .

     

     

     

    Saturday, May 30, 2009 3:25 AM
  • User25861903 posted

     If url rewrite is required you can use urlrewrite.net .

    Saturday, May 30, 2009 3:31 AM
  • User1779468316 posted


     File existance checking can not be disabled . The problem is due to iis configuration . 

    You have to write few configuration lines  in web.config to manage this . 

    Http handlers works  if your web.config can call it properly .

    That's what I thought too, but I haven't been able to figure out what those few configuration lines in web.config might be. Maybe you could enlighten me a bit more?

    BTW, I started trying to use an httpHandler and then realized that it wasn't what I needed for my application. The httpModule works perfectly in development, and all I need is a little assistance getting it to work on the server as well.

    Eric

    http://www.my-msi.net

     

    Saturday, May 30, 2009 11:01 AM