How to do url redirects to my WordPress site and alter landing page accordingly (3 posts)

  1. brianws
    Posted 3 years ago #

    I would like to have some of my unrelated URLs, say bobswebsite.com/home
    and maryswebsite.com/index redirect to my site, mywordpresssite.com/landingpage. And I want mywordpresssite.com/landingpage to then dynamically display the top part
    of the page to show "Bob's Website" or "Mary's Website" depending on which link the user had previously clicked on. How hard is this to do in WordPress? Can a novice to do this or is it strictly for professionals only? Thx.

  2. catacaustic
    very awesome
    Posted 3 years ago #

    It is possible, and it's not that hard. You can use something like this in your template files:

    if (strpos ($_SERVER["HTTP_REFERRER"], "bobswebsite.com") !== false) {
        // Bob's website
        get_header ("bobs");
    elseif (strpos ($_SERVER["HTTP_REFERRER"], "maryswebsite.com") !== false) {
        // Mary's website
        get_header ("marys");
    else {
        // Default header
        get_header ();

    Then you'd set up three header files.


    That lets you put the individual code for each referrer in each header.

    Of course there's other ways of doing this, but that's a quick and easy starting point.

  3. brianws
    Posted 3 years ago #


Topic Closed

This topic has been closed to new replies.

About this Topic