WordPress.org

Ready to get started?Download WordPress

Forums

Redirection
redirect by keywords? (5 posts)

  1. centepines
    Member
    Posted 3 years ago #

    Hi, is there a way to redirect by keywords? Let's say one visitor searchs for "moon" and I want all "moon" searches from Google to land in a certain page?

    If it is possible, what is the code I should set on Redirection?

    Thanks in advance :)

    http://wordpress.org/extend/plugins/redirection/

  2. jrf
    Member
    Posted 3 years ago #

    Yes there is. Have you got a limited number of search phrases for which you want to do this or do you want to do this for all phrases ?
    Have you got some example referer urls for me to work with ?
    And some more info on where you want to redirect to ?

  3. centepines
    Member
    Posted 3 years ago #

    Yes , please bear my English :)

    Google is sending me lots of visits to a page that is incorrect for the search terms people enter. I guess it's because the old page ranks better, but it has nothing to do...anyways, weird Google thing.

    I would like to redirect those visitors to the correct page.

    They come strictly from Google, but google.com, google.co.uk, google.com.au, etc, looking for a 4 keyword phrase, let's just say "ultimo video de Marley"

    I have no idea how to properly redirect those from the plugin. I guess the example you will give, will work with some other phrases - that would be awesome and I really thank you for that :)

    Hope you can understadn this mess!

    cheers

  4. centepines
    Member
    Posted 3 years ago #

    Oh, visitors are landing on let's say http://www.mysite.com/old-video-page instead of http://www.mysite.com/new-video-page

    :)

  5. jrf
    Member
    Posted 3 years ago #

    Try and set up a new redirection with the following settings and let me know how you get on:

    Source URL: /old-video-page
    Match: URL and referrer
    Action: Redirect
    Regex-box: ticked
    Target URL: /new-video-page

    Once the redirect has been added, *edit* the redirection and add the following phrase to the referrer box and make sure the regex box to the right of it is ticked as well:
    ^http://www\.google(?:\.[a-z]{2,4}){1,2}/(?:search|url)\?

    You will see that "Matched" is filled with the Target URL and "Not Matched" is empty. Leave those as they are to make sure that users who want to see the old page (for instance using an internal site link), can.

    Note: the Source URL in the above example isn't a regex and I told you to tick the box anyway. The reason for that is a small bug in the current version of the Redirection plugin code. Currently, if you untick it, the referrer regex box will be unticked too and that is not what you want.

    Now, you can either set up this redirect for each of the pages for which you want this to work or you can try and find some pattern to the old/new page URLs and create a regular expression for the Source URL too. Using your example from your previous reply, the regex would be:

    Source URL: /old-([a-z0-9_-]+)[/]?
    Target URL: /new-$1

    Hope this helps ;-)

    Smile,
    Juliette

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic