I've created my own router based on XenForo_Route_Interface.
In 'match' method I analyse $request->getRequestUri() and after finding some patterns I return $newRoutePath. (I am trying to translate old links (from old forum based on vB) to XF links)
Morover I extended XenForo_Router. In 'match' method I added Rule to $this->_rules array.
Generaly it works as I want... but i have two problems:
1. my forum works on https, but when i try to open URL which has been catched by my custom router on the server there is redirected first to the http and then to https :/
2. example when i have url like 'https://myforum.com/somepage.php?t=3' and my custom router translated that "somepage.php?t=3" i get: https://myforum.com/MY_XF_PROPERLY_LINK/?t=3
Why there is ?t=3 on the end of the link ?