Archived topic
How to set up the Redirect URL for the special page
3 replies · Started by Paul on June 1, 2022
hello how are you
i want to do the redirect url for my special page?
For example :
when the users fill in the form (https://prnt.sc/7c-YQSlQe_LN) at https://www.abc.com/contact-us/, the page url will be redirected to https://www.abc/thank-you/ after submitting the inquiry successfully
pls guide me how to do that in generatepress theme and explain it here
pls check my special page in private information
looking forward to hearing from you
thanks in advance
Hi there,
the Theme has no control over either the form submission or the redirect.
Contact Form 7 provides a doc here that contains a script for redirection:
https://contactform7.com/redirecting-to-another-url-after-submissions/
You can use a GP Hook Element ( in Appearance > Elements ) to add the script to wp_footer hook on the page you require it.
Alternatively there is this plugin:
hi david
thanks for your help
you mean that there are two methods to solve this redirect issue.
The first method:
Step 1: add this script to website
<script>
document.addEventListener( 'wpcf7mailsent', function( event ) {
location = 'https://www.abc/thank-you/';
}, false );
</script>
Notes: the above location is the url of the final redirect page
Step 2, using GP Hook Element ( in Appearance > Elements ) to add the script to wp_footer hook on the page you require it.
Totally redirect will be done with two steps.
The second method: it is the most easy
step 1: install the plugin
step 2, do redirect settings by this plugin,
I guess I'm right about that
Thats correct. And yes the plugin would be easier.