I am trying to set Custom 403 & 404 page with 200 response code using php method http_response_code
It works fine in localhost [XAMP Server] with 200 response code. But it throws 403 & 404 response instead of 200 in CPanel Hosting.
.htaccess
Options -Indexes
DirectorySlash Off
DirectoryIndex index.html .index.php index.php
ErrorDocument 403 /response.php
ErrorDocument 404 /response.php
response.php
<?php
http_response_code(200);
?>
<!-- HTML Document -->
<!DOCTYPE html>
<html>
<head>
Content...
</head>
<body>
Content...
</body>
</html>
Problem Screenshot:
Expectation
Looking for 200 status in Cpanel Hosted Result