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?
I just remembered asking this question before but that there was no satisfactory solution. Has anything changed in the two years since?
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......
Thanks Tim, but that's for errors inside NSF files only.
Oops, just saw the "non-NSF-based". I read it too quick I guess and skipped the "non".
Maybe this helps: {Link}
you can configure this in the domcfg.nsf
Are you sure Peter? I'm fairly certain (93%) that you can't.
You're right, it's just for databases :-(
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.
That's Win32 only Ruediger. My client runs on Linux.
{Link}
Notes.ini setting in 7.0.2:
HTTPMultiErrorPage=/error.html
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!
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.
Thanks Peter, this was on my todo list for tomorrow.
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...)
Or how about an <iframe , a bit nasty mayby ;)
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.
ouch...that last bit about error pages being served with an HTTP 200 instead of 404 isn't pretty either.
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).
Thanks Ian. Any chance you could post here too once it's available?
Peter, looks like this might be fixed in 7.0.3:
{Link}
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?