I have a path of the format www.example.com/aaa and www.example.com/aaa#bbb and I want to redirect it to www.example.com
I tried:
if ($uri ~ ^/(.*)(#.*)?) {
rewrite ^/(.*)(#.*)? / permanent;
}
I even tried #. It seems to go inside if block. It replaces the first part, but the second part is appended to url. The new url becomes like www.example.com/#bbb