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

XF 1.4 Route Filter Not Working

Discussion in 'XenForo Questions and Support' started by kingjavo, Jun 17, 2015.

  1. kingjavo

    kingjavo Member

    Hi,

    I'm trying to change a URL to preserve SEO and redirect, instead of losing the URL altogether.

    I would like the URL to go from...
    simheads.com/forums/joe-montana-16-football/
    to...
    simheads.com/forums/joe-montana-football/

    The original URL is one set in the node to be more friendly as an FYI.

    When I change the Route file from...
    forums/joe-montana-16-football/
    to...
    forums/joe-montana-16-football/

    Both URLs break... can you help please!
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    Try reversing the order of the find and replace routes, e.g. (assuming there's a mistake in the above post)

    Find:
    forums/joe-montana-football/

    Replace:
    forums/joe-montana-16-football/

    And check the "Incoming URL conversion only" checkbox.

    I appreciate that seems backwards, but it should do what you want.
     
  3. kingjavo

    kingjavo Member

    Sorry, correction below...

    When I change the Route file from...
    forums/joe-montana-16-football/
    to...
    forums/joe-montana-football/

    Both URLs break... can you help please!
     
  4. Chris D

    Chris D XenForo Developer Staff Member

    Yeah I assumed it was a mistake. See my post above :)
     
  5. kingjavo

    kingjavo Member

    Checking the Incoming URL didn't fix it BTW...
     
  6. Chris D

    Chris D XenForo Developer Staff Member

    Note the order needs to be reversed... so:

    Find: (New URL)
    Replace: (Old URL)

    Check: Incoming URL
     
  7. kingjavo

    kingjavo Member

    Ah, reversing them fixed it. Is that a bug?
     
  8. kingjavo

    kingjavo Member

    Thanks for the speedy help as always! :)
     
  9. Chris D

    Chris D XenForo Developer Staff Member

    No, it's correct. It seems odd, but it's right.

    There's a decent explanation here:
    https://xenforo.com/community/threads/route-filters.47946/

     

Share This Page