Thursday, January 8, 2009

Custom 404 error page for your Lighttpd webserver


It would be cool to have a custom 404 error page for your webserver. It is very easy to do thoughh, just edit lighttpd.conf.
nano /etc/lighttpd/lighttpd.conf

find the line below in this config file
#server.error-handler-404 = "/error-handler.html"

and uncomment it to
server.error-handler-404 = "/error-handler.html"

Now, you create a file called error-handler.html in your www root ( for my case /var/www/ ).
Restart the server to apply changes
/etc/init.d/lighttpd restart

That is all. You have a custom error page right now. Here is mine :)


No comments:

Post a Comment