I have inherited a web application written in PHP. The code is not the best and I want to start using the Symfony framework. It will be a gradual migration through several releases so I need the legacy pages, web scripts, css files and images to work as they do now.
My plan is to put a Symfony installation in a sub directory of the project's root and set the Apache2 config's document root to the Symfony directory. Then I need to set up Apache2 to serve the legacy scripts from the old document root. Here's a before and after of the directory structure.
lib htdocs htdocs\index.php htdocs\img\logo.png htdocs\css\styles.css sql-updates
lib htdocs htdocs\index.php htdocs\img\logo.png htdocs\css\styles.css sql-updates symfony symfony\app.php
htdocs is the current document root and symfony will be the new document root.
Symfony pretty much works through the app.php script so most requests for Symfony code will go through that.
If any requests for pages or files are not found in the symfony directory I want Apache to look in the htdocs directory as it did before.
Is there a way to do this without moving the URIs for the legacy pages to a sub directory?
E.g. If the previous URI was www.app.com/ascript.php and it resolved to htdocs/ascript.php I don't want to have to change the URI to something like www.app.com/legacy/ascript.php.
Is this possible?