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

  • Home
  • SEARCH
  • 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 9247025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:37:51+00:00 2026-06-18T09:37:51+00:00

In one of the projects I’m working a custom 404 page needs to be

  • 0

In one of the projects I’m working a custom 404 page needs to be implemented for each bundle.

Inside the documentation there is nothing mentioned for such functionality.

I was discussing the issue with some colleagues and was told that it has to use the kernel.exception event, alas this one lacks the information which bundle is calling it.

IMHO this should be fixed by applying a patch to symfony router component which would allow the developer to specify catch-all route which could handle the case further.

Another option would be to change the behavior of the RouterInterface::match method to return consistent output containing the matched path and the bundle which matched it. Currently this is not possible, because it throws an exception if match fails and does not give you any information at all, while it could.

For example, I have an ApiBundle which is defined to handle urls starting with “/api”. Currently the only way to handle this one and set custom 404 page is to get the request at the time of the kernel.exception and preg_match() the url. This, however, is hardcoding that should be avoided as the bundle should not have such knowledge – it is defined under the app/config/routing file.

What’s your opinion?
I would appreciate any other workarounds as well.

  • 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-18T09:37:52+00:00Added an answer on June 18, 2026 at 9:37 am

    I’ve ended up implementing my custom ExceptionController which dispatches an event I called ‘ourCompany.exception_response’.

    • The default bundle has a listener set with priority -1024.
    • If custom bundle processes the exception and sets its response, the event has to be marked and the propagation to be stopped.
    • The custom bundle can use the service container to get whatever it wants in order to determine whether to process the exception or no.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

One of the projects which I am working uses CSS attribute selector [att] CSS
One of the projects I am working on includes a website that is hosted
I have a solution with more then one projects. Is there a way i
On one of projects that I'm working on, we decided to change our presentation
I've created a couple of little few page long websites for one time projects
I have two drop down list on a page. The first one list projects
I'm working on a solution that has two projects: One ASP.NET web application, and
After numerous projects one-way asynchronous message passing looks like the only way to write
I have two projects.One project is build in MVC asp.net and the other project
I have a solution with 3 projects.One of UI (contains web pages) and one

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.