2011-12-06How to handle sfError404Exception
The problem:
Let’s say you need to migrate old website to you new Symfony app. You want to keep all old links working. When they do not match the new link scheme, you want to redirect with 301 (or 302) to correct page in the new URL scheme. All these can be managed via backend module.
My first thought was I need a filter to catch sfError404Exception and handle redirections from there. Well, in Symfony 1.4 you can’t do it without changing the Symfony core files, so it’s not an option. This is because the filters are not even get called, as routing finds out first, that the module and/or action does not exists and throws this exception.
The solution:
Read more…
