add custom message for error 405

This commit is contained in:
Zdenek Borovec 2024-07-31 06:49:03 +02:00
parent 5bb4915f7e
commit d76e88853e
4 changed files with 38 additions and 0 deletions

View file

@ -1,5 +1,6 @@
# Custom error pages # Custom error pages
ErrorDocument 403 /errors/403.php ErrorDocument 403 /errors/403.php
ErrorDocument 404 /errors/404.php ErrorDocument 404 /errors/404.php
ErrorDocument 405 /errors/405.php
ErrorDocument 500 /errors/500.php ErrorDocument 500 /errors/500.php
ErrorDocument 504 /errors/504.php ErrorDocument 504 /errors/504.php

18
assets/errors/405.php Normal file
View file

@ -0,0 +1,18 @@
<?php
$COMMONS = $_SERVER['DOCUMENT_ROOT'] . "/../common";
include_once($COMMONS."/header.php");
display_header("405: Method not allowed");
?>
<article>
<h2>405: Method Not Allowed</h2>
<div class="centered-container">
<img src="https://assets.zdenekborovec.cz/upload/39486004aa605167cdda6623a4a3fa6d/7da36b469b34cc1008639612f0c17e21/d077e6ed1bd1a560a718590ae609422c.gif" alt="GIF of a cat shaking its head.">
</div>
</article>
<?php
include_once($COMMONS."/footer.php");
?>

View file

@ -15,5 +15,6 @@ RewriteRule ^([^\.]+)/$ $1.php
# Custom error pages # Custom error pages
ErrorDocument 403 /errors/403.php ErrorDocument 403 /errors/403.php
ErrorDocument 404 /errors/404.php ErrorDocument 404 /errors/404.php
ErrorDocument 405 /errors/405.php
ErrorDocument 500 /errors/500.php ErrorDocument 500 /errors/500.php
ErrorDocument 503 /errors/503.php ErrorDocument 503 /errors/503.php

18
docs/www/errors/405.php Normal file
View file

@ -0,0 +1,18 @@
<?php
$COMMONS = $_SERVER['DOCUMENT_ROOT'] . "/../common";
include_once($COMMONS."/header.php");
display_header("405: Method not allowed");
?>
<article>
<h2>405: Method Not Allowed</h2>
<div class="centered-container">
<img src="https://assets.zdenekborovec.cz/upload/39486004aa605167cdda6623a4a3fa6d/7da36b469b34cc1008639612f0c17e21/d077e6ed1bd1a560a718590ae609422c.gif" alt="GIF of a cat shaking its head.">
</div>
</article>
<?php
include_once($COMMONS."/footer.php");
?>