I am re-writing an old project using Symfony2 so I can try out the framework. I have urls that will be of the form:
/profile/{id}
in the snazzy way that Symfony2 does it. However, the same page was originally found by doing:
/profile.php?id=12345
So, in case someone has an old URL, I'd like to redirect these links. The problem is, I don't know how to catch routes of this nature. I tried
/profile.php?id={id}
but that didn't seem to work. How can I set up this route?
Follow-up: I do not want to do "catch-all" (because it is non-intuitive to me so I fear future bugs), and I would prefer not to do it via htaccess for the same reason. I think the best option is to match "/profile.php" then in the controller, check that "id" exists in query-string and redirect accordingly. If it does not, I will redirect to 404.