diff --git a/packages/frontend/src/components/Routing.js b/packages/frontend/src/components/Routing.js
index b47246a407..34037a0b02 100644
--- a/packages/frontend/src/components/Routing.js
+++ b/packages/frontend/src/components/Routing.js
@@ -62,6 +62,7 @@ import { PageNotFound } from './page-not-found/PageNotFound';
import Privacy from './privacy/Privacy';
import Terms from './terms/Terms';
import { initAnalytics } from './wallet-migration/metrics';
+import RecoveryRedirect from './wallet-migration/RecoveryRedirect';
import { getMigrationStep } from './wallet-migration/utils';
import WalletMigration, { WALLET_MIGRATION_VIEWS } from './wallet-migration/WalletMigration';
import '../index.css';
@@ -420,6 +421,11 @@ class Routing extends Component {
component={VerifyOwnerWrapper}
/>
)}
+
diff --git a/packages/frontend/src/components/wallet-migration/RecoveryRedirect.jsx b/packages/frontend/src/components/wallet-migration/RecoveryRedirect.jsx
new file mode 100644
index 0000000000..1c428fc602
--- /dev/null
+++ b/packages/frontend/src/components/wallet-migration/RecoveryRedirect.jsx
@@ -0,0 +1,34 @@
+import { useEffect } from 'react';
+import { useLocation } from 'react-router-dom';
+
+import { IS_MAINNET } from '../../config';
+
+const RedirectToTestnet = () => {
+ const location = useLocation();
+
+ useEffect(() => {
+ // Function to reconstruct the URL
+ const reconstructUrl = (url) => {
+ const urlObj = new URL(url);
+ const myNearWalletUrl = IS_MAINNET ? 'https://app.mynearwallet.com/' : 'https://testnet.mynearwallet.com';
+ const newUrl = new URL(myNearWalletUrl);
+ newUrl.pathname = urlObj.pathname;
+ newUrl.search = urlObj.search;
+ newUrl.hash = urlObj.hash;
+ return newUrl.toString();
+ };
+
+ // Get the current URL
+ const currentUrl = window.location.href;
+
+ // Reconstruct the URL
+ const newUrl = reconstructUrl(currentUrl);
+
+ // Redirect to the new URL
+ window.location.replace(newUrl);
+ }, [location]);
+
+ return null;
+};
+
+export default RedirectToTestnet;