Custom 404 page in PHP using .htaccess file.
If page dosen't exist redirect to error.php.
I don't know why but it doesn't work. Notice: Undefined index: REDIRECT_STATUS on line 2
<?php
$error = $_SERVER["REDIRECT_STATUS"];
$ettor_title = '';
$error_message = '';
if($error == 404) {
$ettor_title = '404 Page Not Found';
$error_message = 'The document/file requested was not found on this server';
}
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<h1><?php echo $ettor_title; ?></h1>
<h5><?php echo $error_message; ?></h5>
</body>
</html>
.htaccess
ErrorDocument 404 https://doamin.com/error.php