Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Maja 1 post 21 karma points
    Apr 19, 2010 @ 09:15
    Maja
    0

    Changing http status of bad request pages.

    Hello guys/girls,

     

    I have specific problem with bad request page e.g. www.site.com/badrequest . After Umbraco proceed those bad page it set http status 302 to the same. This  is correct, since it is proceed  to IIS which recognize that http status and redirect that bad request to 404 page that is set on IIS level. This makes a problem to search engine and I would like to set http status to those page on 404. I can not find the moment where Umbraco process those bad pages and set them http status on 302. Mine idea is to bypass IIS 404 redirection in that situation in further manner. I would like to intercept moment where Umbraco set http status on 302 and set the same on 404 and then to redirect those bad request to one specific custom error page.

     

    I’ve created a class which implements the umbraco.interfaces.INotFoundHandler interface and set that in  Umbraco 404handlers.config, but did not work as it should.

    Then I tried to create class which implement  IHttpModule  interface, but did not work as well.

     

    Does anyone have idea how I can solve this problem?

     

    Tnx in advance.

    Maja

  • Thomas Höhler 1237 posts 1709 karma points MVP
    Apr 19, 2010 @ 12:03
    Thomas Höhler
    0

    I' ve implemented several NotFoundHandlers and they are all working well. So which functionality didn't work? Was the NotFoundHandler you wrote touched. Try adding some loginformations in the request eg:

    umbraco.BusinessLogic.Log.Add(LogTypes.Debug, 0, "Executing MyNotFoundHandler");

    is the sequence in the config correct? First Handler is touched first.

    hth, Thomas

Please Sign in or register to post replies

Write your reply to:

Draft