A question that comes to mind is why is the redirect needed in the first place? Usually if you install the forum in a subfolder it means you have a main website (for example, WordPress) at the root. If you're not going to use the root path for another app, why not install the forum at the root?
Make sure you are not accidentally exposing private Flarum files if you are doing this because you had issues removing the subfolder. It's always worth a scan to be sure https://discuss.flarum.org/d/10056-migratetoflarum-lab-the-health-scanner-for-flarum
If this is a temporary redirect while waiting for the main website to be published, using a PHP file can be easier to not forget about it when uploading the website, as removing/replacing the file will automatically remove the redirect instead of having to find where it was defined. Don't forget to use a 302 temporary redirect if that's your use case, otherwise visitors won't be able to load the main website if their browser has cached the redirect.