Issue
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 ?
Solution
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
Answered By - sambit Answer Checked By - Pedro (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.