WordPress.org

Ready to get started?Download WordPress

Forums

Redirect with cookie (3 posts)

  1. fishgun
    Member
    Posted 2 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
    Member
    Posted 2 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
    Member
    Posted 2 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