I had a situation in which my client had been previously using a subdomain for one part of their website, and the main domain for another part of their website. After combining all of them together at one place, I went through and created redirect rules for each of the old pages to where they need to go with the new primary domain. However, we discovered that there were some links in email campaigns that had queries in them that weren’t getting redirected. Thus, SiteGround techs helped me to write some new rules in my .htaccess file, which works even though the server is running nginx.
RewriteCond %{HTTP_HOST} ^old.domain.com$
RewriteRule ^(.*)$ https://domain.com/$1 [R=301,L]
Hope that’s helpful for future purposes.