I have a symfony2 project and I would like to create route (prefix) which would point to my old project which sits on its own in one folder (its not a MVC project). I have decided to create folder inside vendor with name of my old project (symfony/vendor/myOldProject).
So rules are:
http://symfony/oldproject/-> points to the folder or specific file
like (index.php) "symfony/vendor/myOldProject"- pass all traffic after oldproject/ (all GET parameters)
- everything without prefix oldproject will use standard symfony2 routing
Basicaly instead of (routing.yml):
OldProject_homepage:
pattern: /oldproject/ defaults: { _controller: AcmeDemoBundle:Default:index }
Use:
OldProject_homepage:
pattern: /project/ defaults: { /vendor/myOldProject }
How to do it?
I think it’s easier to do with a mod_rewrite rule.
Heck, just storing old project in a separate folder under web (i.e. /web/project/) should do the trick if you’re careful with access rules for code folders
But if you absolutely insist on symfony2 solution, then you will probably need to write a bridge bundle between your old project and new symfony2 one.
Definitely no way to do it like you described in examples.