Redirecting to Wrong Site: Redirecting to wrong site

Hi everyone,

I have a bench setup in production with the following apps installed: ERPNext, HRMS, CRM, and a custom app.

Initially, I created a site (erptest.example.com) and installed all these apps on it. Everything worked well during the testing phase, including the functionalities of my custom app.

After successful tests, I created another site (erpqa.example.com) on the same bench and installed the same set of apps. However, I’ve encountered an issue during testing on the new site:

When I create a new user on erpqa.example.com, the reset password email is sent as expected. But when the user clicks the reset password link in the email, they are redirected to erptest.example.com instead of erpqa.example.com.

Additionally, all other links (such as verification links) sent from erpqa.example.com are also behaving the same way—they redirect to erptest.example.com.

Both sites are in production, and I’m unsure why this redirection issue is occurring. Has anyone else faced a similar issue or know how to resolve this?

Any suggestions or solutions would be greatly appreciated!

Thanks in advance!