Custom 404 page in Joomla 1.5


Joomla 1.5 has a default 404 error page which is devoid of the main website theme. It looks something like this:

404_error



In SEO perspective, the website should have a 404 error page with proper links to the site. According to Google SEO guide, avoid using a design for your 404 pages that isn’t consistent with the rest of your site.

To change the default 404 error page in Joomla 1.5 is quite easy. Just follow these easy steps:

Create a normal article with some message to the users who have arrived on the error page. Publish this article as a menu item and grab the URL for the article. It will be like:

http://www.joomla.in/index.php?option=com_content&view=article&id=122

Now you need to edit the file which contains the code for 404 error page in Joomla. Open the file templates/system/error.php in any editor. Just below this line: defined( ‘_JEXEC’ ) or die( ‘Restricted access’ ); add the following code:

if (($this->error->code) == ’404′) {
header(‘Location: ‘ . $this->baseurl .’index.php?option=com_content&view=article&id=122′);
exit;
}
?>


Replace the old error.php file with this one.

Now you can open any non-existent URL on your website like http://www.domainname.com/non-existent-url.html and you will find that the custom error page has opened.

2 thoughts on “Custom 404 page in Joomla 1.5

  1. Pingback: pligg.com

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.