Setting up Custom Errors pages in MOSS RRS feed

  • Question

  • Morning and thanks for reading.

    I have created a MOSS content page for my custom 404 'page not found' error page but it isn't working as intended. This is what I did:

    1. Made a virtual directory in the root site in IIS with aspx page that redirects to the custom MOSS 404 custom error page that I made

    2. made a copy of sps404.htm in the 12 Hive called redirect404.htm.

    3. edited redirect404.htm to redirect to the page in the virtual directory (I did this because I couldn't work out how or if I could make redirect404.htm point straight to a content page - it only seems to work with the root site or an html page in _layouts.)

    4. Written and run a console application to tell MOSS to use redirect404.htm instead of sps404.html in the event of a 404

    5. IISreset

    When I test my site, it is giving the standard 404 page when I enter a misspelled address. I know that the console application works because i can revert to sps404.htm, which this shows the requested url and the page url in the address bar. When I set it it to my redirect404.htm, it doesn't.

    My question is, do I need to make any further changes? What is missing from my steps that I need to do to get it working? Do I need to change settings in the web.config? E.g. customerrors = On or Off?

    I hope someone has a flash of inspiration for me!

    Thank you.

    Wednesday, April 3, 2013 11:06 AM


  • I think I may have found my own answer here. The dev site I was working on already had an entry in the web.config for custom errors, which I think was upterfering with my logic. There was an entry like this:

        <customErrors mode="On" defaultRedirect="/Pages/Home.aspx">

          <error statusCode="404" redirect="/Pages/Home.aspx" />


    In my authoring site, where the custom 404 was working fine, it was set to <customErrors mode="Off" /> 

    In my live environment it is set to <customErrors mode="On" />. I have tested this in dev and it works too so I'll go with that later when I deploy.

    • Marked as answer by zazie Wednesday, April 3, 2013 8:49 PM
    Wednesday, April 3, 2013 11:39 AM