Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the feedzy-rss-feeds domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /data01/virt126885/domeenid/www.saksadogi.com/codegurus.eu/wp-includes/functions.php on line 6121
Change default Joomla 404 behaviour or style - CodeGurus

Change default Joomla 404 behaviour or style

To show custom 404 page or redirect user on some error to home page or somewhere else copy file error.php located under /templates/system/ into youre template folder eg /templates/mytemplate/error.php.

For example to redirect user on 404 add these lines right after defined( ‘_JEXEC’ ) or die( ‘Restricted access’ );. This works for Joomla 1.5.

if ( $this->error->code == '404' )
{
	header('http://www.google.com');
	exit;
}

For Joomla 1.6 and 1.7 use

$this->error->getCode() == 404

Of course you can just change style and html of the same file. This is just example for the case you want to redirect user to another page and dont want them too see 404 at all or to add some other custom logic.


Posted

in

,

by

Comments

Leave a Reply