I need to move a legacy Drupal 7 site to our new Aegir hosting environment. Unfortunately, the file structure is "non standard". I need to move drupal/materials to drupal/sites/default/files/materials but also need a corresponding path rewrite or redirect .htaccess or http.config is not an option, I need to do it in Drupal.
Redirect module does not do tokens or wild cards. Match_redirect module does not rewrite, but matches on a many to one bases. A rewrite would be better than a redirect.
I cant seem to find an existing contrib - how would I do this in PHP with the Drupal APIs? Would I want to use hook_boot or hook_init?