We use cookies
We use cookies to optimize our website. By continuing to browse the site, you agree to our use of cookies.
New design
Control panel
  • Русский
  • Українська
  • English
  • UAH
  • USD
  • RUB
  • EUR
  • 0-800-307-307 Hotline
  • +38 (044) 392-74-33 Kiev
  • +38 (057) 728-39-00 Kharkiv
  • +38 (056) 794-38-31 Dnipro
  • +38 (032) 229-58-93 Lviv
  • +38 (048) 738-57-70 Odessa
  • +38(093) 170-15-42  Life
  • +38 (067) 400-88-44 Kievstar
  • +1(888)393-24-51  USA, Toll free
  • +44(131)507-01-14  Great Britain
  • +7 (499) 348-28-61 Moscow

2.13.2.17. Setting up a 404 page in Joomla!

You can customize the 404 page by redirecting to the page created:

To create a page inside CMS, do the following:

  1. Open the section "Materials(edit) → Material manager → Create material»:
  2. Enter the data to create the desired 404 page:
    • «Heading"- specify an arbitrary page title.
    • «Material"- in the editor block, specify the text that you want to display on the page.
    • «Condition»- select Publishedby... Otherwise, access to the page will be impossible.
    • «Category»- select the required category. Most often it is best to choose Uncategorised.
    • «Access»- select Publicso that all site visitors have access. Otherwise, they will not be able to get to the 404 page, and the browser will display a page with an infinite redirect error.
  3. Switch to the "Display"And hide unnecessary elements of this page: It is generally best to hide the following elements:
    • «Show labels».
    • «Introductory text».
    • «Material information header».
    • «Category».
    • «Category as link».
    • «Parent Category Title».
    • «Parent category header as link».
    • «Show associations».
    • «Author».
    • «Date of publication».
    • «Navigation».
    • «Show icons».
    • «Print icon».
    • «Number of views».
  4. Save the page by clicking "Save».
  5. As soon as the page is refreshed and the data is saved, pay attention to the browser line and remember the page number indicated after &id=X:
  6. Customize redirecting to this page, specifying as theaddress_established_pages string /index.php?option=com_content&view=article&id=Xwhere instead of X specify the previously saved page number.

To create your own 404 page (without using the Joomla template!), Create such a page, for example, in the root directory of the site with a name like 404-error.phpby using your own layout with the necessary information and visual design or using third-party templates, for example bythese or bythese.

After creating the page itself customize redirecting to it, specifying as theaddress_established_pages filename, for example with the example given earlier /404-error.php.

By default, a 404 error is generated using the file error.php in the theme directory, but for the most part these files have a rather complex structure that ensures correct work with this particular theme.

To create the required call forwarding, do the following:

  1. Rename the file error.php active topic to another arbitrary name, for example error.php.bak.
  2. Copy the file templates/system/error.php to the directory with the active theme.
  3. Edit the file with the redirect lines:
    if (($this->error->getCode()) == '404') {
        header('Location: / address_established_pages');
    exit;
    }

    after the lines

    if (!isset($this->error))
    {
        $this->error = JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
        $this->debug = false;
    }
     
    $app = JFactory::getApplication();

    Instead /address_established_pages specify the desired address of the previously created page.

You can perform all these actions using filemanager or any FTPclient.