Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8595691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:29:51+00:00 2026-06-12T00:29:51+00:00

I have setup custom error pages to display for certain HTTP errors in the

  • 0

I have setup custom error pages to display for certain HTTP errors in the folder:

app/Resources/TwigBundle/views/Exception/

The 403 page (error403.html.twig) works and displays as expected.

The 500 page (error500.html.twig) works and displays as expected.

The 404 page (error404.html.twig) throws a 500 server error:

PHP Fatal error: Uncaught exception ‘Symfony\Component\Routing\Exception\ResourceNotFoundException’

The error is being thrown by doing an auth check to display certain menu items for users that are or aren’t authenticated:

{% if is_granted('IS_AUTHENTICATED_FULLY') %}

If I remove that check and just allow all menu items to display, the page loads the error page as expected. Again, the 403 page displays as it should and utilizes the auth checks without a problem.

I’m stuck on this one. The pages are EXACTLY the same, apart from the filename.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T00:29:53+00:00Added an answer on June 12, 2026 at 12:29 am

    You can’t use the is_granted in a 404 page since 2.1:

    It’s mentioned in the upgrade file

    The Firewall listener is now registered after the Router listener. This means that specific Firewall URLs (like /login_check and /logout) must now have proper routes defined in your routing configuration. Also, if you have a custom 404 error page, make sure that you do not use any security related features such as is_granted on it.

    See:
    https://github.com/symfony/symfony/blob/master/UPGRADE-2.1.md#security

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have custom error pages setup in my ASP.Net 4.0 application. I would like
I have custom error pages setup using <customErrors mode=On defaultRedirect=~/Home/Error> <error statusCode=404 redirect=~/Home/PageNotFound />
I have a php web page that now uses custom error pages when a
I have setup SSL (VIP) for a custom domain on my Google App Engine
I'm trying to setup custom error pages. I put the pages in /error/ in
We have a rails server with custom 404 and 500 pages setup using this
I have a custom error page set up for my application: <customErrors mode=On defaultRedirect=~/errors/GeneralError.aspx
I have the following setup: Web.config has customErrors mode=Off Global.Application_Error() event calls a custom
I have setup Custom Domain https://developers.google.com/appengine/docs/domain I have uploaded An SSL certificate and private
I'm trying to setup custom validation for a checkbox. I have 7 checkboxes each

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.