WordPress lost password redirect

I’d like to redirect WordPress lost password reset link to the main webpage so a link redirect but not sure on the correct syntax.

Desired result is
My.domain/wp-login.php?action=lostpassword
To
My.domain/index.php

I tried
redir “/wp-login.php?action=lostpassword” /
But that didn’t work. I tried removing the “?action=lostpassword” and the redirect did work when going to to the normal login page so redir doesn’t handle the added on action.

Any suggestions on how I can get the url and action to trigger a redirect?

You need to make a named matcher that matches both the path and query:

1 Like

Great many thanks Francis for pointing me in the right direction. Much appreciated.

Just used this which worked fine:

@lostpassword {
path /wp-*
query action=lostpassword
}
respond @lostpassword “Lost password access denied” 403

1 Like