fix error event handling. redirects now accept regular expressions and do internal redirection instead of an http redirect