Support » Plugin: Redirection » Convert path to query parameter

  • Resolved freshcreate

    (@freshcreate)


    Hello, I am trying to create a direct from:

    https://website.com/specific-page/1234
    TO
    https://website.com/specific-page?page_id=1234

    But getting an infinite redirect loop.

    Further, website.com/specific-page and website.com/specific-page/ should have no redirect. Only if there is a value after /specific-page/.

    I have tried various variations, all similar to:

    ^/specific-page/(.*)
    TO
    /specific-page?page_id=1234

    Instead, all attempts redirect to website.com/specific-page?page_id=?page_id=. Any advice is greatly appreciated.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter freshcreate

    (@freshcreate)

    Sorry I had a typo. The variations I have attempted are similar to:

    ^/specific-page/(.*)
    TO
    /specific-page?page_id=$1

    I put page_id=1234 in the example, instead of page_id=$1.

    Plugin Author John Godley

    (@johnny5)

    You need to change your regular expression so it only matches the source URL and not the target URL. For example, maybe use \d instead of . to match numbers and not any character.

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