MyBB Tutorials

Custom 404 Page

Submitted by Mr_Joker, , Thread ID: 4835

Thread Closed

RE: Custom 404 Page

Bassdrop
Neurofunk Selecta
Divine
Level:
0
Reputation:
72
Posts:
593
Likes:
109
Credits:
11.6K
13-08-2018, 08:32 PM
This post was last modified: 13-08-2018, 08:46 PM by Bassdrop
#9
13-08-2018, 08:25 PM
webelious Wrote:
Has anyone tested this compared to the cPanel fix, which is better?

Cpanel just edits the .htaccess file I'm pretty sure.

You can use any html/php file for the error page(s)... you can set all the error types that way, for example:

Quote:ErrorDocument 400 /400.html
ErrorDocument 401 /401.html
ErrorDocument 403 /403.html
ErrorDocument 404/404.html
ErrorDocument 500 /500.html


List oferror codes:

Client Error:
400 - Bad Request
401 - Unauthorized
402 - Payment Required
403 - Forbidden
404 - Not Found
405 - Method Not Allowed
406 - Not Acceptable
407 - Proxy Authentication Required
408 - Request Timeout
409 - Conflict
410 - Gone
411 - Length Required
412 - Precondition Failed
413 - Request Entity Too Large
414 - Request-URI Too Long
415 - Unsupported Media Type
416 - Requested Range Not Satisfiable
417 - Expectation Failed

Server Error:
500 - Internal Server Error
501 - Not Implemented
502 - Bad Gateway
503 - Service Unavailable
504 - Gateway Timeout
505 - HTTP Version Not Supported


You can also put html directly in the .htaccess fileusing a quotation mark before the html (you don't need one at the end, and you can use quotes in the html itself....

For example:

Quote:ErrorDocument 404 "<span style="font-size:1.2em;"><b>404:</b>Shit, we couldn't find that page!</span><br><br>Click <a href="https://your.site/">here</a> to go to the main page or <a href="mailto:[email protected]">email us</a> for help.
ErrorDocument 403 "<center>You're forbidden from accessing this content.<br><span style="font-size:10px"><a href="http://link.to/site">(Return to main page.)</a></center>

Better just to use a separate file though.

Life is like a box of chocolates, it doesn't last as long for fat people.

Users browsing this thread: 1 Guest(s)