Categories

Featured templates

Joomla 3.x. How to add custom 404 page

Margarett Ortiz April 28, 2016
Rating: 5.0/5. From 2 votes.
Please wait...

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
  1. Create an ‘uncategorized’ article in Joomla to serve as your 404 Page, save and close it:

    Joomla_3.x_ How_to_add_custom_404_page_1
  2. On the right side, under ID, you can see an article identification number, please copy and save it.

  3. Create a menu item, which links to the new 404 Article and ‘apply’ changes. Copy menu id number and save it.

  4. 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…):

    Joomla_3.x. How_to_add_custom_404_page_2
  5. 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:

    Joomla_3.x_ How_to_add_custom_404_page_3

Feel free to check the detailed video tutorial below:

Joomla 3.x. How to add custom 404 page
Joomla WebSite templates
This entry was posted in Joomla! Tutorials and tagged 404 Page, custom, joomla. Bookmark the permalink.

Submit a ticket

If you are still unable to find a sufficient tutorial regarding your issue please use the following link to submit a request to our technical support team. We'll provide you with our help and assistance within next 24 hours: Submit a ticket