You can customize the 404 page by redirecting to the page created:
To create a page inside CMS, do the following:
Publishedby
... Otherwise, access to the page will be impossible.Uncategorised
.Public
so 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.&id=X
:address _established_pages
string /index.php?option=com_content&view=article&id=X
where 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.php
by using your own layout with the necessary information and visual design or using third-party templates, for example these or these.
After creating the page itself customize redirecting to it, specifying as address _established_pages
filename, for example with the example given earlier /404-error.php
.
By default, 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 forwarding, do the following:
error.php
active topic to another arbitrary name, for example error.php.bak
.templates/system/error.php
to the directory with the active theme.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 /theaddress_established_pages
specify the desired address of the previously created page.
You can perform all these actions using filemanager or any FTPclient.