For a long time I'm trying to enable custom 404 page for my joomla 2.5 website, because default red error page was not an option.
I enabled it, however, it shows only if user enters site.com/wrong_page and if users enter url of the following structure site.com/wrong_page/wrong_page it doesn't show anything, just blank empty page.
So, If user goes to a page "Goods" and then goes to unexisting item site.com/goods/wrong_itemid it wouldn't show custom error, it shows nothing, but if user opens site.com/wrong_link he will see custom error page.
Please, help me to sort this out.
I used the following in error.php:
switch ($this->error->code) {
case '404':
header('location: /404-page');
break;
case '500':
include('500.php');
break;
case '403':
include('403.php');
break;
default:
header('location: /404-page');
}