modX.sendErrorPage
Last updated Oct 14th, 2026 | Page history | Improve this page | Report an issue
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$194 per month—let's make that $500!
Learn moremodX::sendErrorPage¶
Send the user to a MODX virtual error page.
Syntax¶
void sendErrorPage ([array $options = null])
Before forwarding, the OnPageNotFound event is invoked with $options. The user is then sent to the resource configured in the error_page setting, falling back to site_start if that is not set.
$options may override the defaults filled from the error_page_header, error_page_pagetitle and error_page_message settings:
response_code,error_header— HTTP header line (default404 Not Found)error_type— error type passed on tosendError, default404error_pagetitle— defaultError 404: Page not founderror_message— default<h1>Page not found</h1><p>The page you requested was not found.</p>error_page— resource id of the error page for this call only
Example¶
Send the user to the default Error page for the site.
$modx->sendErrorPage();
See Also¶
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$194 per month—let's make that $500!
Learn more










