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:
filenotfound.php
ACP > Templates & Styles > Templates > *Your Theme* > Add Template
Add this code and customise to your liking.
PHP:
ErrorDocument 404 /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);
?>
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>