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

possibility to add simple mod_rewrite rule or other easy way?

Discussion in 'XenForo Development Discussions' started by Thomas Lamprecht, Nov 30, 2015.

  1. Thomas Lamprecht

    Thomas Lamprecht New Member

    I wanted to ask if it's possible to implement a basic RewriteRule in front of the XenForo Route class/engine?

    Or if there is another easy way to get Rule like
    RewriteRule ^threads/(\d+)-(\w+)$ threads/$2.$1 [R]

    I tried adding a route class but not every format gets through to this class, sometimes a match function on a higher level succeeds and so the request gets redirected to / while loosing the whole path :)

    Best regards,
  2. ThemeHouse

    ThemeHouse Well-Known Member

    I think I may be missing what you're trying to do, but everything is being pointed at index.php by the rewrite included with XenForo. After that XenForo's router takes care of everything.

  3. Thomas Lamprecht

    Thomas Lamprecht New Member

    Yes, I understood that, although I was suprised that the orginal query doesn't gets into the apache access log but only the already routed request, thanks.
    I tried already to add a "Route Addon" which hooks into the route and does my match and replace, and it works sometimes but sometimes a match from higher order gets executed and my class won't get called, like I described in my post... :)

    Has anyone else had such a problem, or is there a more straight forward solution.


Share This Page