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

Can we customize the url pattern?

Discussion in 'XenForo Pre-Sales Questions' started by cedivad, Aug 7, 2010.

  1. cedivad

    cedivad Active Member

  2. Ahmed

    Ahmed Well-Known Member

    I think it's possible to do that if you know mod_rewrite.
     
  3. cedivad

    cedivad Active Member

    No, mod_rewrite do nothing in this case. I don't want to convert the old url structure to the new one but change the new one to fit the old one. It's possible in ipb.
     
  4. Ahmed

    Ahmed Well-Known Member

    Isn't it all don't by mod_rewrite?
     
  5. cedivad

    cedivad Active Member

    No =)

    In the case of this forum mod rewrite takes the url and "pass it" to the controller (index.php). Index.php that decides what to do with the requested url by calling some php classes.
     
  6. Brandon_R

    Brandon_R Guest

    Well i guess we can if we can modify the regexes etc but if urls are hard coded into the templates then we might need to change them also.
     
  7. cedivad

    cedivad Active Member

    I think (and hope) that they did something like ipb, where every urls is generated from a common set of "functions". This way you edit it once and it reflect in output (function => url) and input (requested url => decide witch class to call) urls, really great.

    BTW... if anyone noticed, i always talk about IPB. I think they did an amazing framework and they have an amazing platform with some amazing features, but what they miss is the way user integrate with all that stuff. xF centered the point in this sector =)
     
  8. Mike

    Mike XenForo Developer Staff Member

    All the URLs go through functions, though the approach is for the URLs that we have. You could certainly change them by modifying the "routes" (both building and parsing).
     
    cedivad likes this.
  9. cedivad

    cedivad Active Member

    Routes? Remember me codeigniter.

    Thank you for the reply =)
     
  10. Ahmed

    Ahmed Well-Known Member

    Aaha, I got what you mean just now.

    That's just great. :)
     
  11. Quillz

    Quillz Well-Known Member

    This is good news. I think I'd prefer to have the thread ID listed before the actual name of the thread, too.
     
  12. Brandon_R

    Brandon_R Guest

    Same, and separated with dashes instead of dots.
     
  13. cedivad

    cedivad Active Member

    Dots for separating is interesting IMO.
    =)
     
  14. Mike

    Mike XenForo Developer Staff Member

    The reason for the ID being on the right is mostly for left-to-right reading. The use of a dot for separation is important to avoid ambiguity in a few areas (both in how the URL could be read and technical ambiguity, though mostly the latter).

    The URLs were actually 123-title-here for a long time, so it wouldn't be a particularly hard change, though you'd be hacking the files to do it at least initially.
     
  15. Brandon_R

    Brandon_R Guest

    I think i'll leave it the way it was meant to be come to think of it. :)
     
  16. Tigratrus

    Tigratrus Well-Known Member

    Sweet. That's probably what we'll want to do as well as our VBSEO urls are 123-title-here. I understand that XF would handle the 301 redirects, but if we can replicate the original it'd have to be less load etc...
     
  17. Mike

    Mike XenForo Developer Staff Member

    Note that I did say it'd be file edits. :)

    Regardless, trying to map another forum's URLs into ours directly isn't a good idea. When importing, the IDs may well change (very likely would). It really needs to go through something that can map that.
     
  18. cedivad

    cedivad Active Member

    Since that you have yet to finalize the importer, i'm sure you can edit a few lines of it and at least for topic make the Urls Ids fit the old one =)
    Else we can do it ;)
     
  19. Tigratrus

    Tigratrus Well-Known Member

    Good point. You're dead right, the id's would almost certainly change. Well, 301's exist for a for a reason! ;).
     
  20. cedivad

    cedivad Active Member

    It's not so hard to keep the ids the same..
     

Share This Page