Wednesday, September 08, 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_counterToday12
mod_vvisit_counterYesterday94
mod_vvisit_counterThis week193
mod_vvisit_counterLast week649
mod_vvisit_counterThis month612
mod_vvisit_counterLast month4836
mod_vvisit_counterAll days30225

We have: 1 guests, 1 bots online
Your IP: 38.107.191.96
 , 
Today: Sep 08, 2010

Gallery

No images