CF7 is a cool contact form plugin, so it is operating fully on JavaScript (if enabled) when it comes to sending messages. If we send a message through it, we stay on the same page by default which is proper behavior.
Sometimes we want to redirect to another page after sending like a “Thank you!” page. We can do this the help with JavaScript events.
document.addEventListener( 'wpcf7mailsent', function( event ) { if ( '101' == event.detail.contactFormId ) { location = 'https://www.example.com/thank-you-page-one/'; } else { location = 'https://www.example.com/thank-you-page-two/'; } }, false );
Add the code into one of your script file or into the site’s footer with wp_footer filter between <script></script> tags. You can also catch different form by id too.