4

Joomla is correctly detecting when a page is not found, and redirects me to the error page I have setup. Unfortunately, I've found that the error code being returned is a 500, instead of a 404, and this is coming from Joomla.

Is there a way to get Joomla to return a 404 in this case?

  • How did you set up the error page? An error 500 in this case means the 404 page has a server error. – jackJoe Apr 22 '14 at 19:26
3

In libraries/legacy/controller/legacy.php we changed:

throw new Exception(JText::sprintf('JLIB_APPLICATION_ERROR_VIEW_NOT_FOUND', $name, $type, $prefix), 500);

to

throw new Exception(JText::sprintf('JLIB_APPLICATION_ERROR_VIEW_NOT_FOUND', $name, $type, $prefix), 404);

2

It sounds like your error page may have the wrong permissions set on it so that it isn't able to show, so you end up with a 500 error instead. 500 errors are almost always caused by two things:

  1. Something wrong in your htaccess file
  2. bad permissions on a file or folder

there are other causes, but in my experience those are the two biggies.

  • could you be more specific about what could be wrong in my htaccess file? I've checked to make sure there is not actually a server error. – ContextSwitch Apr 22 '14 at 19:30
  • It could be any number of things. Usually as a test when I have a site 500 on me I rename the htaccess and refresh the page. That won't work for sef urls, but it does work if the front page is jacked, and it might work for your custom 404 page. But how did you make the 404 page? that may be part of the key. – Brian Peat Apr 22 '14 at 19:34
  • its just a php script that joomla redirects to when there's an error, including 404 errors. I previously had a problem with detecting 404's, but now it detects them but throws a 500 – ContextSwitch Apr 22 '14 at 19:36
  • What I mean is, how does joomla know to use it? Is it a plugin? – Brian Peat Apr 22 '14 at 19:39
  • no, its part of the Joomla framework – ContextSwitch Apr 22 '14 at 19:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.