Overrided 404 error page, but it's not being displayed - symfony

I've placed a new 404 template file in:
app/Resources/TwigBundle/views/Exception/error404.html.twig
But it's not being shown when 404 is thrown. I've cleared the cache so not sure what else I could do. Any ideas?
Edit: Never mind, apparently it needs to be:
app/Resources/TwigBundle/views/Exception/exception_full.html.twig

Related

WordPress: Unknown 404 error in console

While its not affecting the site it bugs me that I can't get rid of this 404 error in the console. When I view the page I get this message:
http://myproject.dev/undefined 404 (Not Found)
And when I click to see what it refers to it points to the same line as my doctype declaration, which is a standard . I run a few php variables before this but I tried to swap them out and I still get the message.
I've set up my WP site so that it defaults to a page and this page runs on the default page.php template. Any ideas?

Query string on main page causes 404

In the website we developed,
www.website.com/design?somequerystring
works fine but
www.website.com?somequerystring
causes 404 error. We have already checked and are sure that there is no problem with the codes and it must be something about IIS. Also there is no url re-write. What do you think the error could be? What should we check?

Redirect 404 Error To Another Directory

I am using Symfony 2 framework and I am trying to re-direct my 404 page to another folder on my website. I am wondering how would I do this?
Currently, my 404 error page is located in app/resources/TwigBundle/views/Exception/error404.html.twig. I would like my 404 page to read from src/site/StoreBundle/Resources/views/pages/error404.html.twig.
Note that I only want to re-direct my 404 page. I still want my other errors (500, 503) to remain in app/resources/TwigBundle/views/Exception/error404.html.twig.
I'm not sure why you're wanting to do this so it's difficult to advise but why can't you just put an include in app/resources/TwigBundle/views/Exception/error404.html.twig which pulls in your other template? Be sure to use the correct namespace for your bundle. Something like the below should be fine (edit where appropriate).
{% include 'StoreBundle:pages:error404.html.twig' %}

IIS7 - combination of ASP.NET customErrors, IIS httpErrors

I've seen a number of similar questions to this on StackOverflow and on other sites, but nothing that seems to resolve the issue I'm experiencing.
I'm trying to configure a site to return a 500 status code and a custom error page (static HTML file) for ASP.NET errors that would normally return a 500 where customErrors is set to "Off", and 404 status code for pages that our system reports as not being found (the 404 page is not a static page set via IIS, it's generated by our CMS system).
I'm part way there, but I've hit a bit of a brick wall.
At present, I'm able to return the correct 404 status code where our system returns a page with a 404 status code, but I'm now unable to return a 500 status code for ASP.NET server errors. I managed this by setting Response.TrySkipIisCustomErrors = true. My 500 errors, however, are proving more complicated. If I remove the customErrors config section from my web.config, I get the 500 error but it's the ugly ASP.NET YSOD. I can't seem to get this to point to a custom page using IIS at all, no matter what settings I use for the httpErrors config section and no matter what I set via the IIS GUI. If I add the customErrors section back, I get the custom error page as I'd expect, but I get a 200 or 302 error (depending on the value of redirectMode attribute).
Anyone got any ideas?
In terms of httpErrors config section I've tried the following so far:
Setting errorMode to "Custom" and specifying my static content for errors with a statusCode of "500" and a subStatusCode of "-1" (removing existing 500 error first)
Setting errorMode to "Detailed" and specifying my static content for errors with a statusCode of "500" and a subStatusCode of "-1" (removing existing 500 error first)
Setting existingResponse="PassThrough" for both configuration options above.
It seems you may be going above and beyond what you need to do, that is if I understand you correctly. Here is a good link
It seems like you what you need is to handle the global.asax Application_Error Event. This way you can handle it anyway you like and you dont get that ugly asp.net error screen. Any web app I create I put some code in there to handle errors so the user wont see any unformatted "blow ups"

symfony - admin 404

I'm trying to create a custom 404 page in my admin when something goes wrong and a 404 is thrown.
In my settings.yml file in:
apps/admin/config/settings.yml
I have the following:
all:
.actions:
# 404 module/action
error_404_module: common
error_404_action: error404
I have the module 'common' in my modules folder and I've defined an action called:
executeError404()
and also the template:
error404Success.php
But for some reason, this action never seems to get called as I've tried an exit(); but it still calls the default 404 error message that symfony throws.
Does anyone have any ideas?
Thanks
The custom 404 page doesn't show when in dev mode. If you change your front controller to the production one you should see it if it's configured correctly.
So rather than going to frontend_dev.php got to frontend.php or index.php depending on your setup.

Resources