The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Redirect with cookie (3 posts)

  1. fishgun
    Posted 4 years ago #

    I have two versions of my site in different territories.

    I’d like new users to see a splash page, with a choice of URL A or URL B.

    Once this choice is made, a cookie is set, and the next time the user vista, the cookie redirects to their previously chosen URL.

    any help for a relative noob on this?

  2. Peter Wooster
    Posted 4 years ago #

    You need to get the contents of the cookie from the request before WordPress sends any output to the response. At that point you can use wp-redirect to redirect the user to the desired site. You can use the "init" action to hook in before output is sent.

    You may be better off to use plain php to build the splash page and do the redirects.

    Note that duplicate content isn't good for SEO, so you should be sure to flag one copy as the canonical version for any duplicate content.

  3. girishmanuja
    Posted 4 years ago #

    Hey buddy,
    I'm also looking for the same kind of stuff.

    You get for what you looking for?

    Please share.

Topic Closed

This topic has been closed to new replies.

About this Topic