diff --git a/public_html/.htaccess b/public_html/.htaccess
index 2590a8d3..4dc8c6ec 100644
--- a/public_html/.htaccess
+++ b/public_html/.htaccess
@@ -1,11 +1,11 @@
DirectorySlash Off
Options -Indexes
-RewriteEngine On
-ErrorDocument 403 /dispatch.php?request=error/http&code=403
-ErrorDocument 404 /dispatch.php?request=error/http&code=404
-ErrorDocument 500 /dispatch.php?request=error/http&code=500
+ErrorDocument 403 /fatal-error/403
+ErrorDocument 404 /fatal-error/404
+ErrorDocument 500 /fatal-error/500
+RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}/thumbs/$1.thumb -f
RewriteRule ^/?post/(.*)/thumb/?$ /thumbs/$1.thumb
RewriteRule ^/?thumbs/(.*).thumb - [L,T=image/jpeg]
diff --git a/public_html/dispatch.php b/public_html/dispatch.php
index 89c0d394..5bcfe3f2 100644
--- a/public_html/dispatch.php
+++ b/public_html/dispatch.php
@@ -1,7 +1,10 @@
query = $query;
@@ -70,12 +73,6 @@ try
throw new SimpleNotFoundException($query . ' not found.');
}
}
-catch (\Chibi\MissingViewFileException $e)
-{
- $context->json = true;
- $context->layoutName = 'layout-json';
- renderView();
-}
catch (SimpleException $e)
{
if ($e instanceof SimpleNotFoundException)
diff --git a/src/Controllers/StaticPagesController.php b/src/Controllers/StaticPagesController.php
index 38e1cd45..990704e0 100644
--- a/src/Controllers/StaticPagesController.php
+++ b/src/Controllers/StaticPagesController.php
@@ -35,4 +35,9 @@ class StaticPagesController
$context->path = TextHelper::absolutePath($config->help->paths[$tab]);
$context->tab = $tab;
}
+
+ public function fatalErrorView($code = null)
+ {
+ throw new SimpleException('Error ' . $code . ' while retrieving ' . $_SERVER['REQUEST_URI']);
+ }
}
diff --git a/src/routes.php b/src/routes.php
index d8bc281e..6111bd1b 100644
--- a/src/routes.php
+++ b/src/routes.php
@@ -3,6 +3,8 @@
\Chibi\Router::register(['StaticPagesController', 'mainPageView'], 'GET', '/index');
\Chibi\Router::register(['StaticPagesController', 'helpView'], 'GET', '/help');
\Chibi\Router::register(['StaticPagesController', 'helpView'], 'GET', '/help/{tab}');
+\Chibi\Router::register(['StaticPagesController', 'fatalErrorView'], 'POST', '/fatal-error/{code}');
+\Chibi\Router::register(['StaticPagesController', 'fatalErrorView'], 'GET', '/fatal-error/{code}');
\Chibi\Router::register(['AuthController', 'loginView'], 'GET', '/auth/login');
\Chibi\Router::register(['AuthController', 'loginAction'], 'POST', '/auth/login');