- Web templates
- E-commerce Templates
- CMS & Blog Templates
- Facebook Templates
- Website Builders
Joomla 3.x. How to add custom 404 page
April 28, 2016
Hello! This tutorial will show you how to add a custom 404 page in Joomla 3.
Joomla 3.x. How to add custom 404 page-
Create an ‘uncategorized’ article in Joomla to serve as your 404 Page, save and close it:
-
On the right side, under ID, you can see an article identification number, please copy and save it.
-
Create a menu item, which links to the new 404 Article and ‘apply’ changes. Copy menu id number and save it.
-
Type your site URL into browser address bar and add to it the link in the following format:
index.php?option=com_content&view=article&id=yy&Itemid=xx
In that URL “yy” is the ID of the desired article, in our case, it is the ID of the newly created article. “xx” is the ID of menu item.
Save the link starting from (index.php?option…):
In your Joomla installation directory reach templates/themeXXX/error.php file.
Edit the error.php file as shown below, locate this line of code:
if (($this->error->getCode()) == '404') { header('Location: ' . JRoute::_("index.php?option=com_content&view=article&id=xx&Itemid=xx", false)); exit; }
Replace the path to the page (index.php?option..) with the link that you’ve saved earlier:
Feel free to check the detailed video tutorial below:
Joomla 3.x. How to add custom 404 page