Copied to clipboard

Flag this post as spam?

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


  • MDB 3 posts 23 karma points
    Aug 27, 2015 @ 11:10
    MDB
    0

    redirect to 404 page/node does not work in certain cases

    Hi,

    When I go to this imaginary url (http://mysite.com/language/some-section/some-other-section/?id=3) and try to fetch something by an ID that doesn't exist, i get

    "The resource you are looking for has been removed, had its name changed, or is temporarily unavailable."

    I "throw" the 404 by using "return HttpNotFound()" in our controller.

    If i check in Firebug, I can see that the page does return a 404 not found status code.

    If i go to this imaginary url: http://mysite.com/language/blablabpagethatdoesntexist

    i do get the proper custom 404 page that we set up in the umbracoSettings.Config file.

     <errors>
          <error404>18342</error404>    
        </errors>
    

    web routing section looks like this:

     <web.routing
        trySkipIisCustomErrors="true"
        internalRedirectPreservesTemplate="false">
      </web.routing>
    

    I also tried adding this to the web.config (because it was not there yet):

     <error statusCode="404" redirect="/404"/> 
    

    but that doesnt seem to do the trick, i still get the "resource moved" thing.

    Does anyone have any idea how I can get umbraco to show my custom 404 page on links with bad querystrings ? As i said earlier, I can handle these bad qs values and return the 404 code but i don't get the actual 404 page.

  • MDB 3 posts 23 karma points
    Aug 31, 2015 @ 05:59
    MDB
    0

    anyone?

Please Sign in or register to post replies

Write your reply to:

Draft