• Resolved littlegatsby

    (@littlegatsby)


    Dear plugin creator,

    I feel totally dumb because I am not able to do a simple redirect:
    I want all pages starting with /test/xxxxx redirect to /test/

    So /test/string1/string2/ should redirect to /test/ and /test/12345/ should also redirect to /test/. I tried all kinds of regular expressions like (?=.*[a-z]) to check for at least 1 character after the / but nothing works…

    Thanks in advance

Viewing 1 replies (of 1 total)
  • Nagmay

    (@gabrielmcgovern)

    Not the creator, but maybe I can help.

    /test/.+ will match /test/ with followed by one or more characters:

    • /test/a
    • /test/abc
    • /test/a/b/c/

    However, it will also match:

    • /abc/test/a

    To match only urls that start with /test/, try the following:

    Source URL ^/test/.+
    Target URL /test/
    Regex ?

    • This reply was modified 5 years, 8 months ago by Nagmay.
Viewing 1 replies (of 1 total)
  • The topic ‘Redirect /test/whatever to /test/’ is closed to new replies.