Body: <p>Might be a duplicate, but couldn't find this exact question here. </p>
  
  <p>I have a pretty basic 404.twig template that should be catching things, as described here: <a href="https://docs.craftcms.com/v3/routing.html" rel="nofollow noreferrer">https://docs.craftcms.com/v3/routing.html</a></p>
  
  <p>It works as described on my local environment but I'm getting the generic Craft "Internal Server Error" page on my staging site.</p>
  
  <p>devMode is set to false on both environments, and there is no error prefix specified as in this post: <a href="https://craftcms.stackexchange.com/questions/23145/craft-not-loading-custom-404-template-for-errors">Craft not loading custom 404 template for errors</a></p>
  
  <p>I checked the web-404s log and confirmed that Yii is throwing a NotFoundHttpException when I test pages. I'm not sure what else I should check. Any ideas?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-11-28T20:12:00.697Z
Comments.Text: If it's a Craft-styled 500 ISE, the underlying error message should be in your Craft `storage/logs` folder. Can you check there for it?
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-12-04T19:01:28.723Z
Comments.Text: Finally get a chance to look into this more. I'm getting 
  
  `TemplateLoaderException Unable to find the template “templates/home.twig”`
  
  That template loads correctly when visiting the actual homepage, any idea why Craft would be trying to load this template instead of the 404, or why it would fail to find it when it works during normal site navigation?
Comments.UserDisplayName: slander
Tags: <routing><server><404>
Title: 404 shows "Internal Server Error" only on staging environment
ThreadText: # 404 shows "Internal Server Error" only on staging environment
  
  (Asked by: username_0 on 2019-11-27)
  
  Might be a duplicate, but couldn't find this exact question here.
  
  I have a pretty basic 404.twig template that should be catching things, as described here: <https://docs.craftcms.com/v3/routing.html>
  
  It works as described on my local environment but I'm getting the generic Craft "Internal Server Error" page on my staging site.
  
  devMode is set to false on both environments, and there is no error prefix specified as in this post: [Craft not loading custom 404 template for errors](https://craftcms.stackexchange.com/questions/23145/craft-not-loading-custom-404-template-for-errors)
  
  I checked the web-404s log and confirmed that Yii is throwing a NotFoundHttpException when I test pages. I'm not sure what else I should check. Any ideas?
  
  **Tags:** routing, server, 404
  
  > **Comments:**
  > **username_1**: If it's a Craft-styled 500 ISE, the underlying error message should be in your Craft `storage/logs` folder. Can you check there for it?  
  > **username_0**: Finally get a chance to look into this more. I'm getting   `TemplateLoaderException Unable to find the template “templates/home.twig”`  That template loads correctly when visiting the actual homepage, any idea why Craft would be trying to load this template instead of the 404, or why it would fail to find it when it works during normal site navigation?  
  
  ---
  
  ## 0 answers
  
  