So far, my "TwigBundle" custom error404.html.twig page displays correctly on production mode when I throw:
$this->createNotFoundException('whatevs');
However, when a "NotFoundHttpException" is thrown by Symfony (such as whenever a route is not found), the "no route found" page displays indeed on app_dev, mentioning "404 Not Found", but on production mode it just displays a blank page...
Which does not seem normal since, according to the Symfony documentation: "The createNotFoundException() method creates a special NotFoundHttpException object, which ultimately triggers a 404 HTTP response inside Symfony."
Then why don't I get the same behavior? Is there something I am missing?
I am using the master branch.
EDIT: Here is my security.yml file, I am using FOSUserBundle and FOSFacebookBundle:
security:
providers:
chain_provider:
chain:
providers: [fos_userbundle, my_fos_facebook_provider]
fos_userbundle:
id: fos_user.user_manager
my_fos_facebook_provider:
id: my.facebook.user
encoders:
"FOS\UserBundle\Model\UserInterface": sha512
firewalls:
public:
pattern: ^/
fos_facebook:
app_url: "http://apps.facebook.com/***/"
server_url: "http://localhost/facebookApp/"
login_path: /login
check_path: /checkFb
default_target_path: /
provider: chain_provider
form_login:
login_path: /login
check_path: /login_check
provider: chain_provider
remember_me: true
csrf_provider: form.csrf_provider
remember_me:
key: %secret%
anonymous: true
logout: true
login:
pattern: ^/(login$|register|resetting)
anonymous: true
role_hierarchy:
ROLE_ADMIN: ROLE_ADMIN
ROLE_SUPER_ADMIN: [ROLE_ADMIN, ROLE_ALOOW_TO_SWITCH]
ROLE_USER: ROLE_USER
access_control:
- { path: ^/, role: [IS_AUTHENTICATED_ANONYMOUSLY] }
- { path: ^/secured/, role: [IS_AUTHENTICATED_FULLY] } # This is the route secured with fos_facebook
- { path: ^/facebook/, role: [ROLE_FACEBOOK] }