Answer the question
In order to leave comments, you need to log in
Why doesn't header location work with error_page in nginx?
On my site, when there was still Apache, in .htaccess with a 404 error, index.php was loaded with a redirect to another site in the form:
header("Location: http://site.ru{$_SERVER['REQUEST_URI']}");
Answer the question
In order to leave comments, you need to log in
server {
server_name site1.ru;
rewrite ^(.*) http://site2.ru/$1 permanent;
}
server {
server_name www.site.ru;
rewrite ^(.*) http://site.ru/$1 permanent;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question