views:

25

answers:

2

When building a website in Symfony 1.3 my development server refuses to display my custom 404 page.

I have left the config settings as standard, so my error module is the default, as can be seen in my debug toolbar:

sf_error_404_action: error404
sf_error_404_module: default

This request has been forwarded to a 404 error page by the action "article/edit".

Why is my custom 404 page not shown?

A: 

It turns out that this is actually the default behaviour when debug is turned on.

Turn off debugging if you want to see the actual '404' error page.

index.php: Symfony shows the symfony error page

$configuration = ProjectConfiguration::getApplicationConfiguration('frontend', 'dev', true);
sfContext::createInstance($configuration)->dispatch();

index.php: Symfony shows the custom 404 error page

$configuration = ProjectConfiguration::getApplicationConfiguration('frontend', 'dev', false);
sfContext::createInstance($configuration)->dispatch();
Jon Winstanley
+1  A: 

Why do you use 'dev' in your index.php controller? By convention it's a production controller and uses 'prod' environment with no debug.

kuba