I have a url - https://sambit.com/hub/abc which i want to redirect to https://sambit.com/admin/sites/editors/hub-page/abc/live-preview where abc is a variable value .
i wrote a nginx config like this -
location /hub { rewrite ^/hub(.*)$ https://iwillonlytestit.replica.bangthetable.in/admin/sites/editors/hub-page/$1/live-preview permanent; }
but it doesn't seems to redirect to the url i want .
its redirecting to https://sambit.com/admin/sites/editors/hub-page/.*/live-preview.
Can someone please help me out ?
Asked
Active
Viewed 155 times
-1

sambit
- 339
- 4
- 12
1 Answers
0
I have found a way to achieve the task like follows -
rewrite ^(/hub)(.*)$ https://iwillonlytestit.replica.bangthetable.in/admin/sites/editors/hub-page$2/live-preview permanent;
this redirects from https://iwillonlytestit.replica.bangthetable.in/hub/abc to https://iwillonlytestit.replica.bangthetable.in/admin/sites/editors/hub-page/abc/live-preview

sambit
- 339
- 4
- 12