Instead of putting notfound.html as your parameter, you could use
notfound.tcl and create a new tcl script with this line:
ns_returnfile 404 text/html [ns_server pageroot/global/notfound.html
Save this script as /global/notfound.tcl
Good luck!
Jim
>
> I would like my server to return a custom html page (or even better a
> tcl/adp pair) when a url is not found, with an http status code of
> 404.
>
> When setting this in the config file:
>
> ns_section "ns/server/${servername}/redirects"
> ns_param 404 "/global/notfound.html" ;# Not Found error page
>
> it does return my notfound.html page, but with a 200 status code.
>
> I know I can do 'ns_return 404 text/html' manually somewhere, but
> where would be the best place to call that? In a custom notfound
> tcl/adp pair? In a filter? Or is there a cleaner way to achieve what I
> want?
>
> I only tested this on OpenACS by the way, which calls
> ns_returnnotfound I believe.
>
>
> til
>
>
> --
> AOLserver - http://www.aolserver.com/
>
> To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> with
> the
> body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field
> of your email blank.
>
--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of
your email blank.