]> git.bochard.net Git - mysite.git/commitdiff
added multiple error pages
authorbochard <mail@tenkyuu.dev>
Mon, 28 Apr 2025 01:53:11 +0000 (09:53 +0800)
committerbochard <mail@tenkyuu.dev>
Mon, 28 Apr 2025 01:53:11 +0000 (09:53 +0800)
15 files changed:
.htaccess
error_docs/401.html [new file with mode: 0644]
error_docs/502.html [new file with mode: 0644]
error_docs/503.html [new file with mode: 0644]
error_docs/504.html [new file with mode: 0644]
files/bg_music/another_folder/index.php [deleted file]
files/bg_music/childhood2.mp3 [deleted file]
files/bg_music/index.php [deleted file]
files/bg_music/rejectedworld.mp3 [deleted file]
files/index.php
files/musics/childhood2.mp3 [new file with mode: 0755]
files/musics/index.php [new file with mode: 0644]
files/musics/rejectedworld.mp3 [new file with mode: 0755]
files/musics/sfx/index.php [new file with mode: 0644]
files/wallpapers/index.php

index a9e3f3dcfd2b9a5415fe58299c3853069955dd14..a3f409242e4a41d5774e1dafe30d8d084a1f5387 100644 (file)
--- a/.htaccess
+++ b/.htaccess
@@ -5,6 +5,10 @@ RewriteCond %{HTTP_HOST} ^www\.tenkyuu\.dev [NC]
 RewriteRule ^(.*)$ http://tenkyuu.dev/$1 [R=301,L]
 
 #error pages
-ErrorDocument 404 /error_docs/404.html
+ErrorDocument 401 /error_docs/401.html
 ErrorDocument 403 /error_docs/403.html
-ErrorDocument 500 /error_docs/500.html
\ No newline at end of file
+ErrorDocument 404 /error_docs/404.html
+ErrorDocument 500 /error_docs/500.html
+ErrorDocument 502 /error_docs/502.html
+ErrorDocument 503 /error_docs/503.html
+ErrorDocument 504 /error_docs/504.html
\ No newline at end of file
diff --git a/error_docs/401.html b/error_docs/401.html
new file mode 100644 (file)
index 0000000..204546b
--- /dev/null
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta charset="utf-8">
+  <meta http-equiv="x-ua-compatible" content="ie=edge">
+  <meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
+  <meta name="description" content="Unathorized access.">
+  <title>page doesn't exist!!</title>
+</head>
+<body background="/images/backgrounds/backgroundclouds.gif">
+  <h1>This page requires authenticaion!</h1>
+  <p>Are you just trying to access this page? Smells fishy, huh?!</p>
+  <a href="/">
+    <img src="/images/gifs/backhomepage.gif" width="300" alt="back to home">
+  </a>
+</body>
+</html>
\ No newline at end of file
diff --git a/error_docs/502.html b/error_docs/502.html
new file mode 100644 (file)
index 0000000..e8e701d
--- /dev/null
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta charset="utf-8">
+  <meta http-equiv="x-ua-compatible" content="ie=edge">
+  <meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
+  <meta name="description" content="Bad Gateway...">
+  <title>page doesn't exist!!</title>
+</head>
+<body background="/images/backgrounds/backgroundclouds.gif">
+  <h1>The Gateway is BADASS.</h1>
+  <p>There's a gate problem, it won't budge. It might been stuck.</p>
+  <a href="/">
+    <img src="/images/gifs/backhomepage.gif" width="300" alt="back to home">
+  </a>
+</body>
+</html>
\ No newline at end of file
diff --git a/error_docs/503.html b/error_docs/503.html
new file mode 100644 (file)
index 0000000..38b5d52
--- /dev/null
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta charset="utf-8">
+  <meta http-equiv="x-ua-compatible" content="ie=edge">
+  <meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
+  <meta name="description" content="The server can't serve.">
+  <title>page doesn't exist!!</title>
+</head>
+<body background="/images/backgrounds/backgroundclouds.gif">
+  <h1>Service is unavailable for some reason...</h1>
+  <p>Wait, the waiter is still serving other people. Give some time to him, he's doing his best.</p>
+  <a href="/">
+    <img src="/images/gifs/backhomepage.gif" width="300" alt="back to home">
+  </a>
+</body>
+</html>
\ No newline at end of file
diff --git a/error_docs/504.html b/error_docs/504.html
new file mode 100644 (file)
index 0000000..2a1129b
--- /dev/null
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta charset="utf-8">
+  <meta http-equiv="x-ua-compatible" content="ie=edge">
+  <meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
+  <meta name="description" content="Timeout!">
+  <title>page doesn't exist!!</title>
+</head>
+<body background="/images/backgrounds/backgroundclouds.gif">
+  <h1>You're too slow.</h1>
+  <p>The gate has a timer, you didn't reached it.</p>
+  <a href="/">
+    <img src="/images/gifs/backhomepage.gif" width="300" alt="back to home">
+  </a>
+</body>
+</html>
\ No newline at end of file
diff --git a/files/bg_music/another_folder/index.php b/files/bg_music/another_folder/index.php
deleted file mode 100644 (file)
index 1067e45..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-$urlPath = parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH);
-$urlPath = rtrim($urlPath, "/");
-$fullPath = $urlPath === "" ? "/" : $urlPath;
-
-if ($handle = opendir(".")) {
-    echo "<html>";
-    echo "<head><title>Index of $fullPath</title></head>";
-    echo "<body>";
-    echo "<h1>Index of $fullPath</h1><hr><pre>";
-    echo '<a href="../">../</a>' . PHP_EOL;
-
-    $items = [];
-    while (false !== ($entry = readdir($handle))) {
-        if ($entry != "." && $entry != ".." && $entry != "index.php") {
-            $items[] = $entry;
-        }
-    }
-    closedir($handle);
-
-    sort($items);
-
-    foreach ($items as $entry) {
-        $filePath = "./" . $entry;
-        $lastModified = date("d-M-Y H:i", filemtime($filePath));
-        $size = is_dir($filePath) ? "-" : filesize($filePath);
-        $link = htmlspecialchars($entry);
-
-        if (is_dir($filePath)) {
-            $link .= '/';
-        }
-
-        echo "<a href=\"$entry\">$link</a>" . str_repeat(" ", 50 - strlen($link)) . "$lastModified" . str_repeat(" ", 10 - strlen($size)) . "$size" . PHP_EOL;
-    }
-
-    echo "</pre><hr>";
-    echo "</body>";
-    echo "</html>";
-} else {
-    echo "Unable to open directory.";
-}
-?>
\ No newline at end of file
diff --git a/files/bg_music/childhood2.mp3 b/files/bg_music/childhood2.mp3
deleted file mode 100755 (executable)
index 068a74e..0000000
Binary files a/files/bg_music/childhood2.mp3 and /dev/null differ
diff --git a/files/bg_music/index.php b/files/bg_music/index.php
deleted file mode 100644 (file)
index 1067e45..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-$urlPath = parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH);
-$urlPath = rtrim($urlPath, "/");
-$fullPath = $urlPath === "" ? "/" : $urlPath;
-
-if ($handle = opendir(".")) {
-    echo "<html>";
-    echo "<head><title>Index of $fullPath</title></head>";
-    echo "<body>";
-    echo "<h1>Index of $fullPath</h1><hr><pre>";
-    echo '<a href="../">../</a>' . PHP_EOL;
-
-    $items = [];
-    while (false !== ($entry = readdir($handle))) {
-        if ($entry != "." && $entry != ".." && $entry != "index.php") {
-            $items[] = $entry;
-        }
-    }
-    closedir($handle);
-
-    sort($items);
-
-    foreach ($items as $entry) {
-        $filePath = "./" . $entry;
-        $lastModified = date("d-M-Y H:i", filemtime($filePath));
-        $size = is_dir($filePath) ? "-" : filesize($filePath);
-        $link = htmlspecialchars($entry);
-
-        if (is_dir($filePath)) {
-            $link .= '/';
-        }
-
-        echo "<a href=\"$entry\">$link</a>" . str_repeat(" ", 50 - strlen($link)) . "$lastModified" . str_repeat(" ", 10 - strlen($size)) . "$size" . PHP_EOL;
-    }
-
-    echo "</pre><hr>";
-    echo "</body>";
-    echo "</html>";
-} else {
-    echo "Unable to open directory.";
-}
-?>
\ No newline at end of file
diff --git a/files/bg_music/rejectedworld.mp3 b/files/bg_music/rejectedworld.mp3
deleted file mode 100755 (executable)
index 4c624ef..0000000
Binary files a/files/bg_music/rejectedworld.mp3 and /dev/null differ
index 1067e456922a73270de7f926ba812b959da310cf..3921ebcc0a6a86463f0259f4c3ff19bac8d6f0df 100755 (executable)
@@ -4,39 +4,39 @@ $urlPath = rtrim($urlPath, "/");
 $fullPath = $urlPath === "" ? "/" : $urlPath;
 
 if ($handle = opendir(".")) {
-    echo "<html>";
-    echo "<head><title>Index of $fullPath</title></head>";
-    echo "<body>";
-    echo "<h1>Index of $fullPath</h1><hr><pre>";
-    echo '<a href="../">../</a>' . PHP_EOL;
+  echo "<html>";
+  echo "<head><title>Index of $fullPath</title></head>";
+  echo "<body>";
+  echo "<h1>Index of $fullPath</h1><hr><pre>";
+  echo '<a href="../">../</a>' . PHP_EOL;
 
-    $items = [];
-    while (false !== ($entry = readdir($handle))) {
-        if ($entry != "." && $entry != ".." && $entry != "index.php") {
-            $items[] = $entry;
-        }
+  $items = [];
+  while (false !== ($entry = readdir($handle))) {
+    if ($entry != "." && $entry != ".." && $entry != "index.php") {
+      $items[] = $entry;
     }
-    closedir($handle);
+  }
+  closedir($handle);
 
-    sort($items);
+  sort($items);
 
-    foreach ($items as $entry) {
-        $filePath = "./" . $entry;
-        $lastModified = date("d-M-Y H:i", filemtime($filePath));
-        $size = is_dir($filePath) ? "-" : filesize($filePath);
-        $link = htmlspecialchars($entry);
+  foreach ($items as $entry) {
+    $filePath = "./" . $entry;
+    $lastModified = date("d-M-Y H:i", filemtime($filePath));
+    $size = is_dir($filePath) ? "-" : filesize($filePath);
+    $link = htmlspecialchars($entry);
 
-        if (is_dir($filePath)) {
-            $link .= '/';
-        }
-
-        echo "<a href=\"$entry\">$link</a>" . str_repeat(" ", 50 - strlen($link)) . "$lastModified" . str_repeat(" ", 10 - strlen($size)) . "$size" . PHP_EOL;
+    if (is_dir($filePath)) {
+      $link .= '/';
     }
 
-    echo "</pre><hr>";
-    echo "</body>";
-    echo "</html>";
+    echo "<a href=\"$entry\">$link</a>" . str_repeat(" ", 50 - strlen($link)) . "$lastModified" . str_repeat(" ", 10 - strlen($size)) . "$size" . PHP_EOL;
+  }
+
+  echo "</pre><hr>";
+  echo "</body>";
+  echo "</html>";
 } else {
-    echo "Unable to open directory.";
+  echo "Unable to open directory.";
 }
 ?>
\ No newline at end of file
diff --git a/files/musics/childhood2.mp3 b/files/musics/childhood2.mp3
new file mode 100755 (executable)
index 0000000..068a74e
Binary files /dev/null and b/files/musics/childhood2.mp3 differ
diff --git a/files/musics/index.php b/files/musics/index.php
new file mode 100644 (file)
index 0000000..59ec2e4
--- /dev/null
@@ -0,0 +1,5 @@
+<?php
+  $path = $_SERVER['DOCUMENT_ROOT'];
+  $path .= '/files';
+?>
+<?php include_once($path . '/index.php');?>
\ No newline at end of file
diff --git a/files/musics/rejectedworld.mp3 b/files/musics/rejectedworld.mp3
new file mode 100755 (executable)
index 0000000..4c624ef
Binary files /dev/null and b/files/musics/rejectedworld.mp3 differ
diff --git a/files/musics/sfx/index.php b/files/musics/sfx/index.php
new file mode 100644 (file)
index 0000000..59ec2e4
--- /dev/null
@@ -0,0 +1,5 @@
+<?php
+  $path = $_SERVER['DOCUMENT_ROOT'];
+  $path .= '/files';
+?>
+<?php include_once($path . '/index.php');?>
\ No newline at end of file
index 1067e456922a73270de7f926ba812b959da310cf..59ec2e4bd839250dcd881412a2bddfdb368efd53 100644 (file)
@@ -1,42 +1,5 @@
 <?php
-$urlPath = parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH);
-$urlPath = rtrim($urlPath, "/");
-$fullPath = $urlPath === "" ? "/" : $urlPath;
-
-if ($handle = opendir(".")) {
-    echo "<html>";
-    echo "<head><title>Index of $fullPath</title></head>";
-    echo "<body>";
-    echo "<h1>Index of $fullPath</h1><hr><pre>";
-    echo '<a href="../">../</a>' . PHP_EOL;
-
-    $items = [];
-    while (false !== ($entry = readdir($handle))) {
-        if ($entry != "." && $entry != ".." && $entry != "index.php") {
-            $items[] = $entry;
-        }
-    }
-    closedir($handle);
-
-    sort($items);
-
-    foreach ($items as $entry) {
-        $filePath = "./" . $entry;
-        $lastModified = date("d-M-Y H:i", filemtime($filePath));
-        $size = is_dir($filePath) ? "-" : filesize($filePath);
-        $link = htmlspecialchars($entry);
-
-        if (is_dir($filePath)) {
-            $link .= '/';
-        }
-
-        echo "<a href=\"$entry\">$link</a>" . str_repeat(" ", 50 - strlen($link)) . "$lastModified" . str_repeat(" ", 10 - strlen($size)) . "$size" . PHP_EOL;
-    }
-
-    echo "</pre><hr>";
-    echo "</body>";
-    echo "</html>";
-} else {
-    echo "Unable to open directory.";
-}
-?>
\ No newline at end of file
+  $path = $_SERVER['DOCUMENT_ROOT'];
+  $path .= '/files';
+?>
+<?php include_once($path . '/index.php');?>
\ No newline at end of file