Viewing 2 replies - 1 through 2 (of 2 total)
  • MichaelApproved

    (@michaelapproved)

    I’m struggling with this too. The best I could come up with would be down to 2 requests. One that accounts for the query and one that doesn’t.

    You’ll need regex selected for these.

    1) Look for /post at the very start of the path. The ^ says match the start.
    2) Allow for a / at the end (? = 0 or 1 of the previous character)
    3) End of the string (the $ says that we’re done matching)

    ^/post/?$

    1) Look for /post at the very start of the path. The ^ says match the start.
    2) Allow for a / at the end (? = 0 or 1 of the previous character)
    3) A question mark follows. \? is a question mark that is escaped with a backslash, so the regex knows we literally mean a question mark.

    ^/post/?\?

    It’d be great to have the option of “ignore query strings” so we could just have the first match.

    I updated the github code and created a pull request with the change being requested. Here it is for anyone browsing the support pages

    https://github.com/johngodley/redirection/pull/56

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Redirect all versions o a URL’ is closed to new replies.