• Resolved MatrixMedia

    (@matrixmedia)


    Hello,
    I ask for help to set up a redirect, with regex.

    My starting url is this (old site no wp):
    https://www.mysite.com/?page_id=page_name&obj_id=1234

    “page_name”, it is always the same!

    and the target url is this, without query arg:
    https://www.mysite.com/my-page/

    I tried putting the redirect like this:
    ^page_id=page_name&obj_id=(.*)
    ^/?page_id=page_name&obj_id=(.*)

    ^/?page_id=page_name&obj_id=(\d+)
    ^page_id=page_name&obj_id=(\d+)

    ^page_id=page_name&obj_id=[0-9]*$
    ^/?page_id=page_name&obj_id=[0-9]*$

    where am I wrong?

    thank you for your attention and assistance
    Regards

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

    (@johnny5)

    You can use a site like https://regex101.com to test a regular expression

    Bear in mind that characters such as ? will need escaping to \?. You may also need to clear your browser cache to see an updated redirect.

Viewing 1 replies (of 1 total)
  • The topic ‘Help for REGEX’ is closed to new replies.