Custom 404 pages.. making them work...

All WYSIWYG Web Builder support issues that are not covered in the forums below.
Forum rules
IMPORTANT NOTE!!

DO YOU HAVE A QUESTION OR PROBLEM AND WANT QUICK HELP?
THEN PLEASE SHARE A "DEMO" PROJECT.



PLEASE READ THE FORUM RULES BEFORE YOU POST:
http://www.wysiwygwebbuilder.com/forum/viewtopic.php?f=12&t=1901

MUST READ:
http://www.wysiwygwebbuilder.com/getting_started.html
WYSIWYG Web Builder FAQ
Post Reply
User avatar
zinc
 
 
Posts: 2146
Joined: Sat Dec 08, 2007 3:06 pm
Location: London, United Kingdom
Contact:

Re: Custom 404 pages.. making them work...

Post by zinc »

wwonderfull wrote: Sun Apr 24, 2022 6:44 am
I guess the issue I'm having is how to make it work.. how do I get it to show up when you access a nonexistent page.

With the code <?php http_response_code(404); include('/error/404.php'); // provide your own HTML for the error page die();?> , do I place this in the same file (error/404.php)? or does it go in the .htaccess file?

Do I need this line of code as well, "ErrorDocument 404 /mywebsite.com/error/404.php" line?
For the php code I can say our dear moderator @bacon can assist you with his grateful advice on that.
Do I need this line of code as well, "ErrorDocument 404 /mywebsite.com/error/404.php" line?
404 error page whether it is php or html both needs the .htaccess code. and yes it needs to be put inside your websites directory's .htaccess.

Code: Select all

RewriteEngine on
ErrorDocument 404 http://www.yoursite.com/404.php
or in some cases

Code: Select all

RewriteEngine on
ErrorDocument 404 /errors/404.php

Very useful. Thank you!
Running WYSIWYG Web Builder since 2007...
Post Reply