Steps to create the 404 page 

  1. Create an ‘uncategorized’ article in Joomla! to serve as your 404 page. Add some text like Sorry, the page you are looking for can not be found. You can also add navigation links to the article, so visitors have an easy way to return to your working pages.
  2. Create a menu item witch links the new 404 article and ‘apply’ your changes. Then copy the URL information (index.php?option….), set the menu item as ‘unpublished’ and close out of the menu editing page.
  3. Copy error.php to your templates directory. In your Joomla! installation copy the file error.php from the templates/system directory to your Template directory. For example, if I was using a template named ‘Cleancloud’ I would copy the error.php file to the templates/clean cloud directory.
  4. Modify error.php to Redirect 404 Errors to your 404 Article. Edit the error.php file as follows, adding the code below immediately under the ‘restricted access’ line:

If you are using Joomla 1.6, 1.7, 2.5, or 3.x please use this detection code:

if (($this->error->code) == '404') {
header('Location: /index.php?option=com_content&view=article&id=75');
exit;
}

 

Replace the location information (index.php?option..) with the URL from the menu item you created.

If you are using Joomla 1.5 and below please use this detection code instead:

if (($this->error->code) == '404') {
header('Location: /index.php?option=com_content&view=article&id=75');
exit;
}

What We Just Did 

The above steps you are creating a custom article that shows up if the original articles URL fails. When doing this the browser never actually sees a 404 error it just sees a page created on Joomla! This can help keep your SEO from having negative effects of a bad URL or just the plain “page not found” message.

 

Ця відповідь Вам допомогла? 0 Користувачі, які знайшли це корисним (0 Голосів)