1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.5 Route filter with content wildcard?

Discussion in 'XenForo Questions and Support' started by Mouth, Aug 1, 2016.

  1. Mouth

    Mouth Well-Known Member

    Looking at the Route Filter functionality ( /admin.php?route-filters/ ), I'm wondering if this can be used with wildcard content ID's? I'm finding its accompanying description confusing, I think;

    "The find and replace fields support wildcards in the format of {name}, with a unique name. The same wildcards should be found in both fields. To limit the wildcard to digits, use {name:digit}; to limit to a string, use {name:string}; {name} will match anything but a forward slash."

    Therefore, can I have;
    Find Route: /xfa-blogs/{name}/
    Replace With: /blogs/author/{name}/

    .. and have an incoming URL of /xfa-blogs/user.56051/ redirected to /blogs/author/user.56051/

    Another example;

    Find Route: /xfa-blog-entry/{name}/
    Replace With: /blogs/{name}/

    .. and have an incoming URL of /xfa-blog-entry/pre-learner-anxiety.331/ redirected to /blogs/pre-learner-anxiety.331/
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    Yep that should be possible.

    I think it's simpler than you think, though.

    Find Route: xfa-blogs/
    Replace With: blogs/author/

    And:

    Find Route: xfa-blog-entry/
    Replace With: blogs/

    Uncheck "Incoming URL conversion only" in both cases.
     
  3. Mouth

    Mouth Well-Known Member

    Thanks, tried a few permeations around this but cannot get it working :(

    Screen Shot 2016-08-02 at 01.01.10.png

    Screen Shot 2016-08-02 at 01.00.20.png

    Screen Shot 2016-08-02 at 00.59.21.png
     

Share This Page