Support

Admin Tools

#29202 server Error 500 vs. 404

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Admin Tools version
n/a

Latest post by vthomas on Wednesday, 14 February 2018 11:41 CST

vthomas
Sometime in the past 6 months, most of my joomla 3 sites (but not all) have quit displaying 404 custom error pages. Instead, using the wrong URL gives this:
This page isn’t working
(website) t is currently unable to handle this request.
HTTP ERROR 500

However, the 'wrong URL' is showing up in joomla redirect component, so it sees that it is a file not found.
I have tried to find the answer to this problem elsewhere, can't find the cause.

I am grasping at air now, I know ... but could I have created this issue via htaccess setup somehow? Am wondering there is an Admin Tools settings that might have triggered this, if I messed up a setting. I just went into one the sites, recreated the htaccess file (using AT v.5.0.0) and still did not get a 404 error when I should have, so I doubt this ... but asking anyway.

Interestingly, my most currently developed joomla sites are correctly showing 404 when it is a 404.

Any direction you could give for me in finding the solution to this problem is appreciated! Vicky
 Vicky Thomas

nicholas
Akeeba Staff
Manager
Hi Vicky!

Look in your template's folder for the error.php file. This is called whenever Joomla tries to deal with an application-level error, including 404 Not Found errors. This is the one crashing with a 500 Internal Server Error. For example, if your template is EXAMPLE you should look into <site root>/templates/EXAMPLE/error.php because that's the file that's really crashing.

But wait, how is it even possible that trying to access a non-existent image trigger Joomla's error page? That's because since Joomla 3.3 the .htaccess shipped with it is designed to catch all non-existent files / links and route them to Joomla. Of course Admin Tools' .htaccess Maker had also been updated to create the same kind of basic code.

Why would it do that? Because that's how SEF URLs work! When you type, say, https://www.akeebabackup.com/download/admintools/5-0-1.html, there is no "download/admintools" folder structure on our site's disk, let alone a file called 5-0-1.html. What happens is that this is a "not found" URL. The .htaccess tells Apache to route this through Joomla's index.php file. Joomla's SEF router sees the path of the request (download/admintools/5-0-1.html) and processes it by figuring out menu item structure and calling the relevant component. Had it not found the relevant menu item or otherwise didn't understand what to do with it, Joomla would raise a 404 Not Found exception which results in the template's error.php file being called to render it.

So how come your other sites don't crash? You're using a different -or updated- template :) For what it's worth, we've seen the faulty error.php file on quite a lot of well-known template clubs' older templates. This is the file that very few people test. I know because ours was a bit of a mess, with 60pt text until I spent an evening giving it the time, love and care it deserved a full two years after I had launched the previous iteration of our site :D

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

vthomas
Nicholas, this is such great information! I've been out all morning today but will look at this and check out those files later today. You rock!
I have always appreciated your global view and understanding of Joomla things, thank you so much for explaining this to me.
Sincerely, Vicky
 Vicky Thomas

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!