Answer the question
In order to leave comments, you need to log in
How to implement 511 response from the server?
if($enable==0)
{
# сюда присылает неавторизированных пользователей файерволл
if ($_SERVER['SERVER_NAME'] != "$servername.$domain_name")
{
header("location:http://$servername.$domain_name/index.php?add=" .
urldecode($_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']));
exit;
}
header('HTTP/1.1 511 Network Authentication Required', TRUE, 511);
Answer the question
In order to leave comments, you need to log in
511 Network Authentication Required - this response is not sent by the server to which the request was intended, but by an intermediary server - for example, the provider's server - if the client must first log in to the network, for example, enter a password for a paid Internet access point. It is assumed that the body of the response will return a web authorization form or a redirect to it. Introduced in RFC 6585 Draft
try similar to 301
<?php
header("HTTP/1.1 511 Network Authentication Required ");
header("Location: http://www.host.ru");
exit();
?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question