mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Display an error page if a virtual path doesn't exist
Give user feedback instead of bailing out with an empty HTTP response body. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
parent
361e251bb1
commit
f0be65875b
2 changed files with 18 additions and 0 deletions
14
web/html/404.php
Normal file
14
web/html/404.php
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
set_include_path(get_include_path() . PATH_SEPARATOR . '../lib');
|
||||||
|
|
||||||
|
html_header( __("Page Not Found") );
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div id="error-page" class="box 404">
|
||||||
|
<h2>404 - <?= __("Page Not Found") ?></h2>
|
||||||
|
<p><?= __("Sorry, the page you've requested does not exist.") ?></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
html_footer(AUR_VERSION);
|
|
@ -102,5 +102,9 @@ if (isset($tokens[1]) && '/' . $tokens[1] == get_pkg_route()) {
|
||||||
header("Content-Type: image/png");
|
header("Content-Type: image/png");
|
||||||
include "./$path";
|
include "./$path";
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
header("HTTP/1.0 404 Not Found");
|
||||||
|
include "./404.php";
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue