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

  • Featured
Vicky1225
Forums
Clicks
321
Views
376
Expand your business scale with over 200 million clean IP addresses, stellar features, and affordable prices provided by 922S5Proxy.
Shortie
Forums
Clicks
208
Views
179
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
51
Views
79
ABCProxy is cost-effective, ethical residential proxies network!
Back
Top