Forum OpenACS Development: Response to ADP or TCL for 404 error page

Posted by Bart Teeuwisse on

My earlier example is only to demonstrate that redirecting to an ADP 404 error page does work. The response you see is the output of the example ADP page. Replace it with your own and more apropriate code. The Neophytos's solution has the big advantage of ATS templating.

The best solution in my opinion is to combine both suggestions. Keep the ns/server/${server}/redirects section in your config file and use a slightly modified redirect from Neophytos's original post like so:

rp_serve_abstract_file "[acs_root_dir]/www[ns_config ns/server/[ns_info server]/redirects 404 /global/file-not-found.adp]"

Your 404 error page can then be templated using the entry in the config file or if none is present the default [acs_root_dir]/www/global/file-not-found.adp. The other error pages are redirected to ADP pages that are not templated but can include calls to TCL procs and the database.

Maybe that it is also possible to intercept those redirects and serve abstract files?