http://www.symfony-project.org/book/1_2/06-Inside-the-Controller-Layer#chapter_06_sub_skipping_to_another_action (scroll down a few paragraphs)
Using
http://www.symfony-project.org/api/1_4/sfAction
You have access to a number of 404 redirection methods (redirect404, forward404, forward404If, forward404Unless) which are detailed on the link above. You have access to all of these methods from within your actions:
public function executeAction(sfWebRequest $request)
{
$this->forward404();
}
I would recommend using forward404 instead of redirect404 as the latter will push the redirection back to the browser and show your user the 404 page's URL instead of the URL they attempted to access.
Configuring
You can configure the module and action that should be executed when a 404 is triggered in your application's config/settings.yml
like this:
all:
.actions:
error_404_module: my_module # To be called when a 404 error is raised
error_404_action: my_action # Or when the requested URL doesn't match any route
Update:
For general information on Symfony check out the three books they have available online: http://www.symfony-project.org/doc/1_4/, 'Practical Symfony' being a great place to get started. There is also a complete API reference available: http://www.symfony-project.org/api/1_4/.