Site logo

Archived topic

Redirect to specific page / redirect back in browser

1 reply · Started by Toby on April 13, 2018

Viewing posts 1–2 of 2

I offer free URL analysis in a CTA-widget form on my blog.

"Funnel"
1. visitors fill in their website URL and click "send"
2. redirects to new page (collect email)
3. redirects to a thank you page

On the thank you page I want to redirect the visitor back to that specific blog post they came from. Is it possible?

Now I use this code:

<?php if ( is_page( Thank-You-Page ID ) ) : ?>
<META http-equiv="refresh" content="2;URL=https://www.domain.com/blog">
<?php endif; ?>

I want this function:
<?php if ( is_page( PAGE-ID ) ) : ?>
<META http-equiv="refresh" content="2;URL=https://www.domain.com/blog/blog-post-where-visitor-used-the-CTA-form">
<?php endif; ?>

Hmm, when I think about it I only need to redirect them 2 steps back in their browser. How? =)

Hi there,

I'm afraid I'm not sure how that would work - you would likely need to store that URL somewhere. It might be worth asking over on stackoverflow.com.

This archived topic is closed to new replies.