Copied to clipboard

Flag this post as spam?

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


  • Aya 7 posts 27 karma points
    May 10, 2010 @ 11:27
    Aya
    0

    Creating the 404 Error redirect for the folders

    Hello, I have the following problem:

    I created the 404error.aspx page in Umbraco and added it in the umbracoSettings.config:

        <errors>
          <error404>1409</error404>
        </errors>

    It works perfectly fine for cases like "/hello.aspx".

    When I write smth like that: "/helllllllllllllloooo" (without .aspx) it doesn't come to the 404 custom page.

     

    What can I do to make it work even for second case?

  • Tobias Neugebauer 52 posts 92 karma points
    May 10, 2010 @ 13:28
    Tobias Neugebauer
    2

    Hi,

    since your iis server interpretes this request as a directory request it will check your iis settings for the default document. Normally ther is something like index.htm which will not go through the asp.net pipline and umbraco will not get invoked on this request. So I would suggest you add default.aspx to the list of default documents and move it in to the first position. In that case iis should try to load /helllllllllllllloooo/default.aspx which would invoke the umbraco runtime and your 404error.aspx would be called.

    Hope this helps

    Toby

  • Aya 7 posts 27 karma points
    May 11, 2010 @ 13:59
    Aya
    0

    Hi Tobias!

    Thanks for your answer.

    Unfortunatelly I still have the same problem. The first default document in the IIS is default.aspx, but I get the standart error page instead of my custom page 404error.aspx.

    404 - File or directory not found.

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

  • Tobias Neugebauer 52 posts 92 karma points
    May 11, 2010 @ 14:41
    Tobias Neugebauer
    0

    Hi,

    sorry that didn't make it :(

    That is what we did and it works on our site (i had a look in our iss config but everything seems normal). I did a quick test to see if http://my.local.machine/some-none-existing-site-or-directory gets handeld by asp.net. It does! What Version of IIS are you using if you are running IIS 7 can you check that integrated mode is selected for your appPool?

    If nothing else works just explicitly configure this in iis as your 404 page.

    Cheers, Toby

  • kipusoep 1568 posts 3995 karma points c-trib
    May 11, 2010 @ 14:51
    kipusoep
    0

    You could also create your own 404 Handler and configure it with Umbraco (so you don't need to edit IIS settings)

  • Tobias Neugebauer 52 posts 92 karma points
    May 11, 2010 @ 15:13
    Tobias Neugebauer
    0

    But I think exactly this will not work because it seem that the asp pipline is not invoked on a call to a directory otherwise the umbraco 404 handler would have executed and the correct page would have been displayed!?

    I might be totally wrong but thats my point of view here

  • Sebastiaan Janssen 4520 posts 12509 karma points MVP admin hq
    May 11, 2010 @ 15:22
    Sebastiaan Janssen
    0

    This should work if you setup the wildcard mapping as described here.

  • Aya 7 posts 27 karma points
    May 11, 2010 @ 15:23
    Aya
    0

    Hi again!

    I use IIS7. By default all new application pools on the system run in Integrated mode. I checked, it's integrated mode. But it doesn't help too much.

    I was trying to configure the 404 in IIS. The result is following: IIS takes care about the error and redirects to my custom error404.aspx. But with "200 OK" Status.

    For the SEO purposes it's really important to keep also status 404 as well as show custom page.

    That's why I suppose it's important to let Umbraco to take care about the error.

    Any other suggestions? Is it only 404 Handler that might help me?

  • Sebastiaan Janssen 4520 posts 12509 karma points MVP admin hq
    May 11, 2010 @ 15:26
    Sebastiaan Janssen
    0

    About wildcard mapping on IIS7, have a read here.

  • Connie DeCinko 931 posts 1156 karma points
    Sep 27, 2010 @ 19:47
    Connie DeCinko
    0

    Sebastian,

    The link provided does not address a production setup.  The article describes a hack workaround only suggested for a local development workstation.

     

Please Sign in or register to post replies

Write your reply to:

Draft