I have a legacy application that I want to wrap in a new symfony project. In order to separate things clearly I decided to move the entire legacy application into a folder legacy
which lies outside the document root.
Since some of the legacy scripts should still be called directly, I created an Alias and wrote a RewriteRule:
Alias /legacy_public "C:\project_root\legacy\public"
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}/../legacy/public%{REQUEST_URI} -f
RewriteRule ^(.*)$ /legacy_public$1 [PT,L]
[...]
This works as long as there is no path info involved. For example, calling the URL www.example.org/showLogo.php
correctly checks if the file exists, rewrites the URL and executes the script.
However, the script expects some path info data in order to work correctly.
When calling www.example.org/inc/showLogo.php/38
the above RewriteCond does not match, because there is no file named showLogo.php/38
.
After studying the documentation it is unclear to me how I should change the condition in order discard the path_info-Part before testing -f