Thursday, July 29, 2010
   
Text Size

redirect 404 / 301 pages page not found error page in joomla

Joomla

User Rating: / 0
PoorBest 

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.

 


Add comment


Security code
Refresh

Featured Links:
Banner
Banner
mod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_counter
mod_vvisit_counterToday51
mod_vvisit_counterYesterday87
mod_vvisit_counterThis week845
mod_vvisit_counterLast week952
mod_vvisit_counterThis month4540
mod_vvisit_counterLast month3893
mod_vvisit_counterAll days24120

We have: 1 guests, 2 bots online
Your IP: 38.107.191.97
 , 
Today: Jul 29, 2010

Gallery

No images