• Resolved Hound

    (@houns)


    Hi,

    I want to redirect this URL:

    https://shop.domain.com/?liff_state=%2Fcart%2F%3Fadd-to-cart%3D1961

    with query string extraction on last four digits (product ID) to this destination:

    https://shop.domain.com/cart/?add-to-cart=1961

    try a lot of regex combinations but doesn’t work, could you please help?

    liff_state\=(.*) doesn’t work either

    • This topic was modified 3 years, 3 months ago by Hound.
    • This topic was modified 3 years, 3 months ago by Hound.
    • This topic was modified 3 years, 3 months ago by Hound.
    • This topic was modified 3 years, 3 months ago by Hound.
    • This topic was modified 3 years, 3 months ago by Hound.
    • This topic was modified 3 years, 3 months ago by Hound.
    • This topic was modified 3 years, 3 months ago by Hound.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author John Godley

    (@johnny5)

    How doesn’t it work? Can you give the exact settings you’ve used?

    More details about regular expressions can be found here:

    https://redirection.me/support/redirect-regular-expressions/

    Thread Starter Hound

    (@houns)

    Hi,

    here’s the set ups for regex:

    settings:

    but works with exact match URL set up,

    settings:

    Thanks,

    • This reply was modified 3 years, 3 months ago by Hound.
    Plugin Author John Godley

    (@johnny5)

    Sure, your regular expression doesn’t match the whole URL and doesn’t seem to do the same thing as the plain redirect.

    You don’t need the \.

    Thread Starter Hound

    (@houns)

    Hi, thanks for your kind support

    After removing the \ the liff_state is gone but still get ? after the root domain and duplicates directory unicode symbol.

    SETUP

    liff_state=(.*)
    /$1/

    source:
    https://shop.domain.com/?liff_state=%2Fcart%2F

    redirect to
    https://shop.domain.com/?%2F%2Fcart%2F%2F

    also try:
    https://shop.domain.com/?liff_state=/cart/

    redirect to
    https://shop.domain.com/?%2F%2Fcart%2F%2F

    • This reply was modified 3 years, 2 months ago by Hound.
    Thread Starter Hound

    (@houns)

    found a workaround with

    \?liff.state=.*?add-to-cart...(.*)

    many thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Redirect with query string extraction’ is closed to new replies.