[Klone-users] Error 404 redefined

Mickael Auger mickael.auger at gmail.com
Thu Apr 10 06:20:45 EDT 2008


Hi,

I wish to use a custom error 404 Web page.

I create an "error404.klone" file in "/webapp/www/"

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
<html>
<body>
<p>My 404 error</p>
</body>
</html>
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=



and I modify "/webapp/etc/kloned.conf" as :

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    app_http
    {
        type            http

        addr.type       IPv4
        addr.port       8080
        dir_root        /www

        error.404                /error404.klone
    }
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=



I compile and I launch KLone
    make
    kloned -d

My modification is made

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  server_list: app_http
  allow_root: yes
  log:
    type: syslog
    syslog:
      facility: LOG_LOCAL0
      priority: LOG_DEBUG
  app_http:
    type: http
    addr:
      type: IPv4
      port: 8080
    dir_root: /www
    error:
      404: /error404.klone
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=



But if I enter a wrong address of page, my web-browser (Firefox 2.0.0.13)
displays :
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

My 404 error
HTTP/1.0 404 Not Found Server: klone/2.0.2 Date: Thu, 10 Apr 2008 10:14:24
GMT Cache-Control: no-cache, must-revalidate Expires: Mon, 1 Jan 1990
05:00:00 GMT Pragma: no-cache Content-Type: text/html Not Found

URL: /error404.klone
------------------------------
KLone/2.0.2 web server - www.koanlogic.com
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


If I replace the "error404.klone" extension by "html", my web-browser
displays an empty page.

I think that this problem can be resolve in modifying the
"http_print_error_page()" function in
"/build/target/klone-core-2.0.2/src/libhttp/http.c" line 406.

Thanks.

-- 
Mickaël AUGER
mickael.auger at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://koanlogic.com/pipermail/klone-users/attachments/20080410/43b2ecaa/attachment.htm


More information about the klone-users mailing list