Welcome to Admin Junkies, Guest — join our community!

Register or log in to explore all our content and services for free on Admin Junkies.

How to create a custom error 404 message?

_B_

Addicted member
Joined
May 18, 2020
Messages
934
Credits
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>
 
Advertisement Placeholder

Log in or register to unlock full forum benefits!

Log in or register to unlock full forum benefits!

Register

Register on Admin Junkies completely free.

Register now
Log in

If you have an account, please log in

Log in
Who read this thread (Total readers: 0)
No registered users viewing this thread.

New Threads

Would You Rather #9

  • Start a forum in a popular but highly competitive niche

    Votes: 9 27.3%
  • Initiate a forum within a limited-known niche with zero competition

    Votes: 24 72.7%
Win this space by entering the Website of The Month Contest

Theme editor

Theme customizations

Graphic Backgrounds

Granite Backgrounds