I have page with pagination which google marked as duplicate content, basically I have this page /asl/candidates/ and /asl/candidates/?page=1 is the same page. What I want to do is to 301 redirect /asl/candidates/?page=1 to /asl/candidates/
I tried
location = /asl/candidates/?page=1{
return 301 /asl/candidates/;
}
But it seems it does not work with query strings.