I need help with nginx redirection
I want to redirect:
example.com/new-clock/?bc=search&search_id=202 to www.example.com
I have used this code in nginx config
rewrite ^/new-clock/?bc=search&search_id=202$ https://www.example.com/ permanent;
But it shows 404, when I remove the query string (?bc=search&search_id=202) and keep only
rewrite ^/new-clock/$ https://www.example.com/ permanent;
then it redirects to www.example.com/?bc=search&search_id=202
I want it to redirect to www.example.com only, dont want query string in final destination.
Thanks :)