wwonderfull wrote: ↑Sun Apr 24, 2022 6:44 amFor the php code I can say our dear moderator @bacon can assist you with his grateful advice on that.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?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.Do I need this line of code as well, "ErrorDocument 404 /mywebsite.com/error/404.php" line?or in some casesCode: Select all
RewriteEngine on ErrorDocument 404 http://www.yoursite.com/404.php
Code: Select all
RewriteEngine on ErrorDocument 404 /errors/404.php
Very useful. Thank you!