I am trying to redirect a page using HTTP 410 status using php header function as
header("HTTP/1.1 410 Gone");
header('Location: http://domain.com/down.php');
exit;
The problem is that even if I set a 410 status code…the status code will automatically change to 302
I have also tried with
header('Location: domain.com/down.php', true, 410);
exit;
It shows 410 redirection but the redirected page does not show anything. It shows a blank page.
Does anybody know if there is a solution for this?
The 410 error indicates that the Web server has no forwarding address for the URL, so can provide no redirection to the new Web server. So the blank page you got using the second snippet is correct.
The first code snippet also gives the correct result –
Locationcreates a redirect to a given address.So there is no errors in your code or in PHP. I’m not sure you do what you realy need =)