Direct Dynamic URL in root to a location within template

There isn’t much “dynamic” about actually creating folder tree and index files in it. What you have right now is completely tangential to your WordPress installation.

In a nutshell, if you need to integrate this with WordPress, you have two approaches:

  1. Load WordPress core in your code. This can be done with including wp-load.php and some fine–tuning, but it’s pretty advanced technique (done properly).

  2. Load your code in WordPress. This will involve getting it in line with WP mechanics and likely using Rewrite API to deal with links.

Either is quite involved really. Keeping standalone functionality separate might actually be quite practical, if you are not willing to spent time on adapting it properly.