What's new

How to create a custom error 404 message?

_B_

Resident Member
500 Posts Club
May 18, 2020
934
4
USD
$0.0000USD
Biznotes
0
This has been picked from this thread on the MyBB site. I'll just add it here because I think it's worth sharing :)

1) Open up your .htaccess file with notepad or notepad++ and add this code to the bottom:
PHP:
ErrorDocument 404 /filenotfound.php
filenotfound.php
PHP:
<?php 
? ? define('IN_MYBB', 1);
? ? require_once("global.php");

? ? add_breadcrumb("404 Error", $_SERVER['PHP_SELF']); 

? ? eval("\$page = \"".$templates->get("404")."\";"); 

? ? output_page($page);
?>
ACP > Templates & Styles > Templates > *Your Theme* > Add Template
Add this code and customise to your liking.
PHP:
<html>
<head>
<title>Your title</title>
{$headerinclude}
</head>
<body>
{$header}
Your 404 Page Content
{$footer}
</body>
</html>
 
This is rather interesting because i always thought that this was a standard error message for any site and i was not aware that you can customize it to this extent.
 

Newest Directory Listings

Shortie
Forums
Clicks
29
Views
92
Comments
1
WWE Hub is a discussion forum for all things wrestling! Share and chat with other wrestling fans throughout the world!
momode
Forums
Clicks
12
Views
53
ABCProxy is cost-effective, ethical residential proxies network!
coderway
Forums
Clicks
11
Views
60
AI digital artwork generator
Back
Top