WordPress.org

Support

Support » How-To and Troubleshooting » Changing blog based on referral url

Changing blog based on referral url

  • DonaldFoley

    @donaldfoley

    Hi,

    Does any one know how I could change my blog menu content when the site was visited from a certain url. This is an example of what I want. I hand out biz cards with not my usual blog url (http://www.donaldcfoley.com/blog/) but a different one (http://www.donaldcfoley.com/card/) and when the person links to it, it automatically jumps to the blog url. Then in the blog I look to see if the referral url is from the card, and I can change some content that I want highlighted to people who came to the site from my card. Is there a way to do this easily. How can you check the referral site, I know my hosts seems to be grabbing that info. And how do I modify content based on that. Any help would be greatly appreciated. Also, I tried searching to see if this was already discussed and found no info.

    Thanks and Kind Regards,
    Donald C. Foley

    Home: http://www.donaldcfoley.com
    Blog: http://www.donaldcfoley.com/blog/
    IMDB: http://www.imdb.com/name/nm1975841/

Viewing 2 replies - 1 through 2 (of 2 total)
  • DonaldFoley

    @donaldfoley

    I did learn how to view the referral if it came through a click: $_SERVER[‘HTTP_REFERER’]

    Unfortunatly I want to see if it came from my redirect page which has the following meta tag:

    <META HTTP-EQUIV=”refresh” content=”0;URL=http://www.donaldcfoley.com/wordpress”>

    Is there a way in PHP to see the referfal url of the site that just auto refreshed to the blog site?

    DonaldFoley

    @donaldfoley

    Ok, I think I figured out a way to do this. By adding post data to the url. I believe I can use $_GET() to find if the wordpress blog was referred from a specific site I set up.

    <META HTTP-EQUIV=”refresh” content=”0;URL=http://www.donaldcfoley.com/wordpress?camefrom=card>

    <?php if ($_GET[“camefrom”] = “card”) then show special case content ?>

    I have not had time to try it, I will give updates soon. I hope this is helpful. If you have done something like this or have any comments please let me know.

    Don

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Changing blog based on referral url’ is closed to new replies.
Skip to toolbar