i am trying to change HTTP STATUS
of 404
and 403
to 200 OK
With PHP, it easy to do but the problem is my website is .html
and i cannot change it to .php
for some reason.
Code (PHP) :
header("Status: 200 OK");
i want same on .htaccess
. so it will automatically change HTTP response code to 200 Ok
for 404
& 403
.
Htaccess Code :
RewriteEngine On
#ErrorDocument
ErrorDocument 403 /forbidden.html
ErrorDocument 404 /notfound.html
ErrorDocument 500 /servererror.html
# Disable directory browsing
Options -Indexes
#Change status code to 200 OK
<IfModule mod_headers.c>
<If "%{REQUEST_STATUS} in { '404','403', '500' }">
Header set HTTP/1.1 "200 OK"
Header set HTTP/2 "200 OK"
</If>
</IfModule>