F
F
Filantropp2020-01-10 18:20:43
Nginx
Filantropp, 2020-01-10 18:20:43

Nginx, rewrite - how to change the URL in the address bar?

Hello.
In the thread How to rewrite in Nginx without changing the URL in the address bar? they ask how to make a redirect without changing the URL in the address bar, but my situation is exactly the opposite!
I wanted to make beautiful short addresses. For example, instead of

https://www.domain.ru/mod/bigbluebuttonbn/view.php?id=156

do
https://www.domain.ru/webinar-156.html
Write inside server {} rule -
rewrite ^/webinar-(.*) https://www.domain.ru/mod/bigbluebuttonbn/view.php?id=$1 last;

And everything seems to work, if you enter in the address bar https://www.domain.ru/webinar-156.html, then what you need opens, but at the same time the address in the address bar changes to
https://www.domain.ru/mod/bigbluebuttonbn/view.php?id=156

But then I would like to hide it ...
What could be the matter?
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel Mezhuev, 2020-01-13
@mezhuev

ngx_http_rewrite_module
returns a permanent 301 redirect.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question