Quantcast
Channel: MyBB Community Forums - Tutorials
Viewing all articles
Browse latest Browse all 685

Custom 404 Page Creation For Mybb Without Any Plugin

$
0
0
1. Add this code to the last line on your .htaccess

Code:
ErrorDocument 404 /filenotfound.php

2.Create a file called filenotfound.php, and add this to it:

Code:
<?php
    define('IN_MYBB', 1);
    require_once("global.php");

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

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

    output_page($page);
?>

3. Upload the filenotfound.php file to your main website's directory.

4. Create a new template on your main theme with the name 404 and add this to it:


Code:
<html>
<head>
<title>Your title</title>
{$headerinclude}
</head>
<body>
{$header}
Your 404 Page Content
{$footer}
</body>
</html>

Edit where it says Your 404 Page Content to whatever suits your needs.


Credits:Ocean

Viewing all articles
Browse latest Browse all 685

Trending Articles