From 621c4df3dda50a4dbcd7bb4444147583fb5b6af1 Mon Sep 17 00:00:00 2001 From: gravel Date: Sun, 7 Jan 2024 21:24:26 +0000 Subject: [PATCH] Add 404 page --- etc/nginx/main.conf | 9 ++++++--- output/js/404.js | 1 + sites/error/404/index.php | 40 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 output/js/404.js create mode 100644 sites/error/404/index.php diff --git a/etc/nginx/main.conf b/etc/nginx/main.conf index c00ffc3..7429b7d 100644 --- a/etc/nginx/main.conf +++ b/etc/nginx/main.conf @@ -1,7 +1,10 @@ + error_page 404 /error/404/index.html; + location /icons { expires 60m; # add_header Cache-Control "max-age=3600"; } + location /qr-codes { # while an underestimate, # this prevents us from tracking users across visits @@ -9,6 +12,6 @@ # add_header Cache-Control "max-age=3600"; } - location ~* ^/(about|privacy|donate|instructions)\.html$ { - rewrite (.*)\.html$ $1 permanent; - } + location ~* ^/(about|privacy|donate|instructions)\.html$ { + rewrite (.*)\.html$ $1 permanent; + } diff --git a/output/js/404.js b/output/js/404.js new file mode 100644 index 0000000..64f5887 --- /dev/null +++ b/output/js/404.js @@ -0,0 +1 @@ +setTimeout(() => { location.pathname = "/"; }, 5000); diff --git a/sites/error/404/index.php b/sites/error/404/index.php new file mode 100644 index 0000000..556ba13 --- /dev/null +++ b/sites/error/404/index.php @@ -0,0 +1,40 @@ + + + + + + + + 404 Not Found — sessioncommunities.online + + + + + + + + + +

404 — Page Not Found

+ +

Oops! Broken link!

+ +

+ The Session Community are trying to view + is not located at this URL. +

+ +

+ Redirecting you to main page in 5 seconds... +

+ +

+ If the redirect fails, click here. +

+ + + + +