diff --git a/client/hosting/hosting-features/components/hosting-features.tsx b/client/hosting/hosting-features/components/hosting-features.tsx index 3fce5bf12da6a..5cba8cdf5cad4 100644 --- a/client/hosting/hosting-features/components/hosting-features.tsx +++ b/client/hosting/hosting-features/components/hosting-features.tsx @@ -42,6 +42,7 @@ const HostingFeatures = () => { const dispatch = useDispatch(); const { searchParams } = new URL( document.location.toString() ); const showActivationModal = searchParams.get( 'activate' ) !== null; + const redirectToParam = searchParams.get( 'redirect_to' ); const [ showEligibility, setShowEligibility ] = useState( showActivationModal ); const siteId = useSelector( getSelectedSiteId ); const { siteSlug, isSiteAtomic, hasSftpFeature, isPlanExpired } = useSelector( ( state ) => ( { @@ -137,7 +138,9 @@ const HostingFeatures = () => { dispatch( recordTracksEvent( 'calypso_hosting_features_activate_confirm' ) ); const params = new URLSearchParams( { siteId: String( siteId ), - redirect_to: addQueryArgs( redirectUrl, { hosting_features: 'activated' } ), + redirect_to: addQueryArgs( redirectToParam ?? redirectUrl, { + hosting_features: 'activated', + } ), feature: FEATURE_SFTP, initiate_transfer_context: 'hosting', initiate_transfer_geo_affinity: options.geo_affinity || '',