Remove Query String in Nginx

I’ve removed and uninstall the some plugins, and I would like to prevent it display some error or 404, so I apply this way to nginx.conf redirection.

If you want to redirect permanent, then you can use 302.

if ($query_string ~ "^(.*)amp(.*)$") {
    return 301 $uri;


1 thought on “Remove Query String in Nginx”

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.