开发者

Symfony: sfError404Exception: This request has been forwarded to a 404 error page by the action

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

I have left the config set开发者_开发问答tings 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?


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();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜