How to remove hypen (-) using nginx rewrite rule?

user3382916 asked:

I am using this rewrite rule to redirect —->

rewrite ^/a-b-c?id=learn-More permanent

But its not working !! It is redirecting to (learn-more is not converted to learnmore).

How to achieve this?

My answer:

If you just have one (or maybe a few) of these to match exactly, then you can check the argument explicitly.

if ($arg_id = "learn-More"} {
    return 301 $scheme://$http_host$uri?id=learnMore

View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.