From 13c06715fc0542c3bfef69f8eff6a361da1d3e7a Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Sat, 19 Oct 2013 09:16:57 +0200 Subject: [PATCH] [IMPROVED] Adding customizable error page to MPOS * `.htaccess` is used to re-define the error documents * redirects to `index.php?page=error&action=` * does not work for MPOS inside subfolders yet Addresses #734. If this works we can add this to all the other themes. --- public/.htaccess | 1 + public/include/pages/error.inc.php | 9 +++++++++ public/include/pages/error/404.inc.php | 9 +++++++++ public/templates/mpos/error/404/default.tpl | 6 ++++++ public/templates/mpos/error/default.tpl | 6 ++++++ 5 files changed, 31 insertions(+) create mode 100644 public/include/pages/error.inc.php create mode 100644 public/include/pages/error/404.inc.php create mode 100644 public/templates/mpos/error/404/default.tpl create mode 100644 public/templates/mpos/error/default.tpl diff --git a/public/.htaccess b/public/.htaccess index 1caaddc0..9750f3bb 100644 --- a/public/.htaccess +++ b/public/.htaccess @@ -1,3 +1,4 @@ +ErrorDocument 404 /index.php?page=error&action=404 RedirectMatch 404 /templates(/|$) RedirectMatch 404 /include(/|$) RedirectMatch 404 /.git(/|$) diff --git a/public/include/pages/error.inc.php b/public/include/pages/error.inc.php new file mode 100644 index 00000000..aecab054 --- /dev/null +++ b/public/include/pages/error.inc.php @@ -0,0 +1,9 @@ +assign("CONTENT", "default.tpl"); +?> diff --git a/public/include/pages/error/404.inc.php b/public/include/pages/error/404.inc.php new file mode 100644 index 00000000..aecab054 --- /dev/null +++ b/public/include/pages/error/404.inc.php @@ -0,0 +1,9 @@ +assign("CONTENT", "default.tpl"); +?> diff --git a/public/templates/mpos/error/404/default.tpl b/public/templates/mpos/error/404/default.tpl new file mode 100644 index 00000000..36f017b7 --- /dev/null +++ b/public/templates/mpos/error/404/default.tpl @@ -0,0 +1,6 @@ +
+

{$GLOBAL.website.name}

+
+

The page you requested was not found.

+
+
diff --git a/public/templates/mpos/error/default.tpl b/public/templates/mpos/error/default.tpl new file mode 100644 index 00000000..36f017b7 --- /dev/null +++ b/public/templates/mpos/error/default.tpl @@ -0,0 +1,6 @@ +
+

{$GLOBAL.website.name}

+
+

The page you requested was not found.

+
+