Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • cbtt Friend
    #920400

    I’m trying to create a custom 404 page using an article. I edited the error.php file as follows and it does the trick — it redirects to the desired page:

    <?php
    
    defined('_JEXEC') or die;
    
    if (($this->error->getCode()) == '404') {
    header('Location: /index.php?option=com_content&view=article&id=349');
    exit;
    }

    However, the article does not show up. If I load up the article from a menu bar (http://beta.cbtt.sk/index.php/404) it all displays OK. However, direct linking (http://beta.cbtt.sk/index.php?option=com_content&view=article&id=349) does not help.

    Any ideas what might be wrong / needed to be done?

    Saguaros Moderator
    #920749

    Hi

    In Joomla, each article will belong to one menu item page. In your site, you’re assign that article to menu item call 404 so it will be opened in that menu item only.

    cbtt Friend
    #920888

    I have figured it out now. I needed to create a new menu that is not assigned anywhere on the website. Then I created a menu item that is published. But because the menu itself is not published, it does not show up. The menu item is a single article linking to my custom 404 article page. Now it all works!

    Saguaros Moderator
    #921305

    That’s great!!!

Viewing 4 posts - 1 through 4 (of 4 total)

This topic contains 3 replies, has 2 voices, and was last updated by  Saguaros 8 years, 7 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum