D
D
Dirty_Racoon2018-04-10 19:13:17
Nginx
Dirty_Racoon, 2018-04-10 19:13:17

How to replace a word in a URL?

Hello.
Please help me figure out Nginx.
There is a page address www.domain.ru/news/blog/2018/blablabla
How to change the address to www.domain.ru/news/blog/2018/tratata ?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
TyzhSysAdmin, 2018-04-10
@POS_troi

Maybe something like this.

location ~* /news/blog/2018/blablabla {
    rewrite ^ /news/blog/2018/tratata permanent;
  }

D
Dirty_Racoon, 2018-04-11
@Dirty_Racoon

I found the solution
rewrite ^/(.+)/blablabla$ /$1/tratata permanent;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question