There are a couple of ways to do this. You could either set redirection rules in your web server configuration files to redirect the old URLs to the new one. Or use the inbuilt functionality that comes with Discourse to redirect the old URLs to the new one. Just follow the official documentation here. https://meta.discourse.org/t/redirecting-old-forum-urls-to-new-discourse-urls/20930.