Redirect to Welcome page if user comes from certain referrer
-
We merged a retail and a wholesale website into one WP site, with wholesale prices showing up based upon ‘roles’.
We set up the old wholesale domain to redirect to the /wholesale welcome page.
https://www.old-ws-site.com
301 to
https://www.new-all-in-one-site.com/ws-welcome pageHowever, now any pages index in google will redirect to non-existing pages.
e.g. https://www.old-ws-site.com/product-category
goes to
https://www.new-all-in-one-site.com/ws-welcome page/product-categorySo I want to change the redirect to go to our https://www.new-all-in-one-site.com/ and then have WP check if the user came from https://www.old-ws-site.com and redirect them to the https://www.new-all-in-one-site.com/ws-welcome page. That way, anything linked within google, would point to the new site product category https://www.new-all-in-one-site.com/product-category
But Wholesale customers who type in the old url, would be brought to the Welcome page.
I’ve tried using the <?php wp_get_referer(); ?> but can’t seem to get it to work.
Any help would be greatly appreciated.
- The topic ‘Redirect to Welcome page if user comes from certain referrer’ is closed to new replies.