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

XF 1.2 URL routing help

Discussion in 'XenForo Questions and Support' started by dvsDave, Sep 23, 2013.

  1. dvsDave

    dvsDave Well-Known Member

  2. Jeremy

    Jeremy XenForo Moderator Staff Member

    Use a mod rewrite to permanently redirect to the new URL.
     
  3. dvsDave

    dvsDave Well-Known Member

    crud. Regex/mod rewrite is not my forte.

    I have no idea how take an already canonical URL and make it un-canonical.
     
  4. Jeremy

    Jeremy XenForo Moderator Staff Member

    If @Jake Bunce doesn't answer you by the time I get back on a computer I'll try to get it for you. It's a matter of RegEx.
     
  5. dvsDave

    dvsDave Well-Known Member

    Sigh... Here's what I've got, but I know it's not working:

    Code:
    RewriteRule /wiki/([A-Za-z0-9-]+)$  wiki/?title=$1 [NC,R=301]
     
  6. dvsDave

    dvsDave Well-Known Member

    thanks @Jeremy ! (I still start to type your old username before I remember that you changed it)
     
  7. Jeremy

    Jeremy XenForo Moderator Staff Member

    I expect a lot of people do. I'm slightly distracted, but I don't want to write RegEx without my regexpal.com up to see how it'll interact.
     
  8. dvsDave

    dvsDave Well-Known Member

  9. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Put this at the top of the .htaccess file in your web root:

    Code:
    RewriteEngine On
    
    RewriteRule ^wiki/(.+)$ /wiki/?title=$1 [R=301,L]
    
    That should do it.
     
    Jeremy likes this.
  10. dvsDave

    dvsDave Well-Known Member

    That checks out! Thanks much!!
     

Share This Page