D
D
D99100992017-04-24 19:38:55
Nginx
D9910099, 2017-04-24 19:38:55

How to compose rewrite nginx?

Hello,
there is a domain and a site with a forum on it:
http://site.ru/forum/viewforum.php?f=4
it is moving to a new domain, and the forum has moved to the root
http://newsite.ru/viewforum.php?f=4
How to rewrite? Help me please.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Burov, 2017-04-24
@D9910099

On the old domain do ^

location ~ ^/forum/(.*)$ {
  return 301 http://newsite.ru/$1$is_args$args;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question