In Joomla you will find a default Joomla 404 page. Thus often you might want to redirect those not found pages to some other page or your main site. To do so please follow the steps as below
1. Edit error.php file under templates/system/ folder of your Joomla installation.
2. Copy this code below immediately following the ### defined( '_JEXEC' ) or die( 'Restricted access' ); ## in your error.php.
## if (($this->error->code) == '404') {
## header('Location: http://www.yourdomain.com/');
## exit;
So the code looks somewhat like this (Ignore "##" signs)
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
if (($this->error->code) == '404') {
header('Location: http://www.yourdomain.com/');
exit;
}
?>
This should redirect the 404 not found error page to your main site.
| Next > |
|---|












