Forum

ErrorHandler is not working

James
2 March 2014, 14:35
I have a VirtualHost:
VirtualHost {
Hostname = example.com
WebsiteRoot = /srv/http/hiawatha/wwwRedirect
StartFile = index.php
ExecuteCGI = yes
ErrorHandler = 404:/index.php
}


404 errors aren't handled as expected - instead the default 404 page is returned and the logfiles show this:
98.81.0.0|Sat 01 Mar 2014 12:00:00 -0600|/srv/http/hiawatha/wwwRedirect/index.php|ErrorHandler not found

The page is a simple PHP script to append www. to the URL, so the page could theoretically 404 in somethig.com (which only contains the one page) but exist on www.example.com, so I'd like to redirect it all to the www. before I display any errors.

Hiawatha version: 9.3
Operating System: Arch Linux
Hugo Leisink
2 March 2014, 14:47
The ErrorHandler is working as it should, just tested it. Could it be that the 404 is sent by the website you redirected to? What if you don't redirect but just print some statement for testing?
James
2 March 2014, 15:00
Okay, I just found out that the 404 pages ARE on the www. domain.. It's been working all along.
Sorry about that,
Hugo Leisink
2 March 2014, 15:08
No problem.
This topic has been closed.