0

I am trying to redirect based on a specific query string:

https://foo.com/wp-login.php?action=register to https://foo.com/account/

location ~* /(wp-login\.php) {
        if ($query_string = "action=register") {
                rewrite ^ https://foo.com/account/ permanent;
        }

    limit_req zone=xwplogin burst=1 nodelay;
    #limit_conn xwpconlimit 30;
    auth_basic "Private";
    #auth_basic_user_file /home/nginx/domains/foo.com/htpasswd_wplogin;
    include /usr/local/nginx/conf/php-wpsc.conf;
    # https://community.centminmod.com/posts/18828/
    #include /usr/local/nginx/conf/php-rediscache.conf;
}
JCats
  • 141
  • 5
  • 13

1 Answers1

0

Try this:

server {
  # ...
  rewrite ^/wp-login\.php\?action=register$ https://foo.com/account/ permanent;
  # ...
}
Mohsen
  • 4,536
  • 2
  • 27
  • 49