Support » Plugin: Redirection » Can we redirect all pages, with a string in them?

  • Resolved simon_a6

    (@simon_a6)


    We are taking on a client that has a website using WPML, but we are moving them away from it.

    So we need to change, for example, http://www.domain.com/en/contact, to http://www.domain/contact. But this will be for a large number of pages, both for en, fr and a few others.

    Obviously we don’t want to do each individual page, so what is the best way to apply it for EN, FR, IT etc? So it basically removing the first two characters after .com/?

    Many thanks
    Simon

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author John Godley

    (@johnny5)

    Thread Starter simon_a6

    (@simon_a6)

    Sorry not quite with you.
    I can see there how you might change one word for another. I want to remove those four types of letters, so it is not /en/contact, but /contact.

    Simon

    Plugin Author John Godley

    (@johnny5)

    Sure, you can use a regular expression to match the original, capture the remainder of the URL and then insert it into the target.

    There are examples at the bottom of the page of how to capture and insert data.

    Thread Starter simon_a6

    (@simon_a6)

    Source
    /en/(.*)
    Target
    /$1/

    Source
    /fr/(.*)
    Target
    /$1/

    For example…?

    Plugin Author John Godley

    (@johnny5)

    Sure, if that matches your requirements. You can give it a try.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.