mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 17:36:38 +02:00

In previous versions of Moodle we recommended use of the fallback resource with /error/index.php. This is incompatible with the routing system because they use the same mechanism for responding to any unknown request. To better handle this we need to move the current error handler page to a routed page, and to provide a shim for the old location. At the same time we need to improve the Slim Error handling middleware to respond with our 404 handler for all 404s, except for those on API routes where we always respond with JSON.
29 lines
1 KiB
PHP
29 lines
1 KiB
PHP
<?php
|
|
// This file is part of Moodle - http://moodle.org/
|
|
//
|
|
// Moodle is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU General Public License as published by
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
// (at your option) any later version.
|
|
//
|
|
// Moodle is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU General Public License for more details.
|
|
//
|
|
// You should have received a copy of the GNU General Public License
|
|
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
/**
|
|
* Moodle 404 Error page
|
|
*
|
|
* This is for 404 error pages served by the webserver and then passed
|
|
* to Moodle to be rendered using the site theme.
|
|
*
|
|
* ErrorDocument 404 /error/index.php
|
|
*
|
|
* @package core
|
|
* @copyright Brendan Heywood <brendan@catalyst-au.net>
|
|
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
*/
|
|
require_once("../r.php");
|