logo

Custom 404 Outside The NSF

This is one of those questions that I'm sure is answered in the forums, but I'm damned if I can find the it.

I've been asked by a customer if I can make non-NSF-based 404 errors look nice. Ones like this codestore.net/foo, which simply say:

Http Status Code: 404
Reason: File not found or unable to read file

My response was to tell them that it's not possible, but that I was only 95% sure of it and more than happy to investigate. When I say investigate I mean ask you lot.

So, can you do anything about this 404 page? Does it involve DSAPI coding or is it simply a flat HTML page on the server somewhere?

Comments

    • avatar
    • Jake Howlett
    • Wed 4 Jul 2007 05:52 AM

    I just remembered asking this question before but that there was no satisfactory solution. Has anything changed in the two years since?

  1. Hi Jake,

    I use the "$$ReturnGeneralError" form. And use a computed text field called "MessageString" (which is the value as well). And it seems to work.

    There is also a topic on this on the IBM site:

    {Link}

    Hope it helps......

    • avatar
    • Jake Howlett
    • Wed 4 Jul 2007 06:20 AM

    Thanks Tim, but that's for errors inside NSF files only.

  2. Oops, just saw the "non-NSF-based". I read it too quick I guess and skipped the "non".

    Maybe this helps: {Link}

  3. you can configure this in the domcfg.nsf

    • avatar
    • Jake Howlett
    • Wed 4 Jul 2007 07:35 AM

    Are you sure Peter? I'm fairly certain (93%) that you can't.

  4. You're right, it's just for databases :-(

    • avatar
    • Ruediger Seiffert
    • Wed 4 Jul 2007 07:58 AM

    hi, there is a dsapi-filter which achieves this:

    {Link}

    from the site:

    In Domino ND6 it is not easy to customise the page that the user sees if they request a page which does not exist (known as a 404 page not found error). Tron Systems have built a piece of software (known as a Domino DSAPI filter) that allows the error page that users see to be customised.

    • avatar
    • Jake Howlett
    • Wed 4 Jul 2007 08:07 AM

    That's Win32 only Ruediger. My client runs on Linux.

  5. {Link}

    Notes.ini setting in 7.0.2:

    HTTPMultiErrorPage=/error.html

    • avatar
    • Jake Howlett
    • Wed 4 Jul 2007 09:10 AM

    Brilliant Peter. Thanks for that. I would never of found it.

    It's a shame you can't point it at an NSF form. I even tried a URL redirect of /error.html to /error.nsf/error?openform but it didn't work.

    Only having a static HTML page isn't perfecft, but it's better than nothing!

  6. error.html could do the redirect to the database (although that's not optimal either).

    <script>document.location.replace("/url/to/database/errorform?open")</script>

    document.location.replace replaces the current page's place in the history-stack with the one you specify.

    • avatar
    • philosophical
    • Wed 4 Jul 2007 03:08 PM

    Thanks Peter, this was on my todo list for tomorrow.

  7. Not to sound like an ajax evangelist, but couldn't the error.html use ajax to pull your form based message into a div? (onDomIsReady ofcourse...)

  8. Or how about an <iframe , a bit nasty mayby ;)

  9. Are we all forgetting the possibility of having Apache (or IIS on windows) handle the non-.NSF content?

    That, I think, would allow you to direct the user to an .nsf.

  10. ouch...that last bit about error pages being served with an HTTP 200 instead of 404 isn't pretty either.

  11. There is a link to our DSAPI filter in this thread which Jake quite rightly says is Win32 only. We'll post a Linux version soon (next few weeks).

    • avatar
    • Jake Howlett
    • Fri 6 Jul 2007 09:55 AM

    Thanks Ian. Any chance you could post here too once it's available?

  12. Peter, looks like this might be fixed in 7.0.3:

    {Link}

    • avatar
    • Yel
    • Fri 31 Aug 2007 01:38 AM

    Here's how I solved it: I've set a 'Default site' to an error.html page (it also could be an nsf).

    Perhaps this helps (until upgrading to 7.03).

    Btw does somebody know if this is also implemented in R8?

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment:


About This Page

Written by Jake Howlett on Wed 4 Jul 2007

Share This Page

# ( ) '

Comments

The most recent comments added:

Skip to the comments or add your own.

You can subscribe to an individual RSS feed of comments on this entry.

Let's Get Social


About This Website

CodeStore is all about web development. Concentrating on Lotus Domino, ASP.NET, Flex, SharePoint and all things internet.

Your host is Jake Howlett who runs his own web development company called Rockall Design and is always on the lookout for new and interesting work to do.

You can find me on Twitter and on Linked In.

Read more about this site »

More Content