如何捕获“找不到资源”异常并重定向 URL 而不是显示错误


how can I catch 'resource not found' exception and redirect url instead of showing an error?

我有一个网站,在 Apache 2.2 和 Zend Framework 1.11.5 上使用 php 5.3。

每当用户尝试进入不存在的页面时,他都会收到异常"找不到资源"。 如何捕获该异常并将用户重定向到同一路径上的其他域,而不是显示错误?

您可以修改ErrorController::errorAction()以检测/重定向那些未找到的异常。