Conditional Redirect

[ad_1]

Anyone know a simple Javascript code to do a conditional redirect? For example, redirect to one url if the link came from Twitter and a different one for Facebook then with anything else it loads as normal? The plugins I have found don’t seem to work in this situation.

[ad_2]
1 Comment
  1. Hi,

    You can use the “document.referrer” ([https://developer.mozilla.org/en-US/docs/Web/API/Document/referrer]) to get the visitor’s previous URL and then apply the conditional logic for redirection.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer