XF 2.2 Convert PHPBB style url links to XENFORO


I am importing phpbb forum to xenforo. The url in phpbb is structured like this:
In Xenforo, on the other hand, it's built like this:
The question is whether / how it is possible to program something that when it gets in the old style that will convert it to new.
Is this something that should be done through htacess?
Or encode it in a new viewtopic.php file?

And whether Redirect 301 should be configured

Thank you
Top Bottom