Answer the question
In order to leave comments, you need to log in
How to compose a double redirect in nginx?
Hello,
I recently asked for help in redirecting a request.
http://site.ru/forum/viewforum.php?f=4
http://newsite.ru/viewforum.php?f=4
server {
listen 80;
server_name site.ru;
location ~ ^/forum/(.*)$ {
return 301 http://newsite.su/$1$is_args$args; }
}
http://site.ru/forum/viewforum.php?f=4
then we get to http://newsite.ru/viewforum.php?f=4
, and if we simply score http://site.ru/
by, we get a 404 error. http://site.ru/forum/viewforum.php?f=4
http://newsite.ru/viewforum.php?f=4
http://site.ru/всё_что_угодно
(EXCEPT - the forum) is http://newsite.ru/
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question