Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • Pankaj Sharma Moderator
    #1085457

    Hi
    The page you disable is just an article page.
    The 404 page is in template folder/error.php file.
    You can customise the page and redirect it to article page with help of this documentation.

    Hope it helps,

    Regards

    timpennington Friend
    #1085638

    Thanks; the instruction you gave me say this:

    Modify error.php to Redirect 404 Errors to your 404 Article
    Edit the error.php file as follows, adding the code below immediately under the ‘restricted access’ line:
    If you are using Joomla 1.6, 1.7, 2.5, or 3.x please use this detection code:

    if (($this->error->getCode()) == ‘404’) {
    header(‘Location: /index.php?option=com_content&view=article&id=75’);
    exit;
    }

    Where is the "restricted access line"?

    Here is what I have in my error.php file:

    <?php
    /**

    • JA Healthcare Template
    • Copyright (C) 2004-2011 J.O.O.M Solutions Co., Ltd. All Rights Reserved.
    • @license – Copyrighted Commercial Software
    • Author: J.O.O.M Solutions Co., Ltd
    • Websites: http://www.joomlart.comhttp://www.joomlancers.com
    • This file may not be redistributed in whole or significant part.
    • */

    defined(‘JEXEC’) or die;
    if (!isset($this->error)) {
    $this->error = JError::raiseWarning(404, JText::
    (‘JERROR_ALERTNOAUTHOR’));
    $this->debug = false;
    }
    //get language and direction
    $doc = JFactory::getDocument();
    $this->language = $doc->language;
    $this->direction = $doc->direction;
    $theme = JFactory::getApplication()->getTemplate(true)->params->get(‘theme’, ”);
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>">

    error->getCode(); ?> – title; ?>

    <link rel="stylesheet" href="baseurl ?>/templates/template ?>/css/error.css” type=”text/css” />

    <link rel="stylesheet" href="baseurl ?>/templates/template ?>/css/themes//error.css” type=”text/css” />

    </script>

    <body class="page-error">
    <div class="main">
    <div class="error">
    <div id="outline">
    <div id="errorboxoutline">
    <div id="animationSandbox" class="error-code bounceInDown animated">
    <?php
    $errcode = str_split($this->error->getCode());
    $i = 0;
    $lastclass=”;
    foreach($errcode as $c){
    $firstclass = ($i==0)?’first’:”;
    if($i==(count($errcode)-1)){
    $lastclass=’last’;
    }
    echo ‘<span class="’.$lastclass.$firstclass.’ error-‘.$c.’">’.$c.’‘;
    $i++;
    }
    ?>

                    <div class="error-message"><h2><?php echo $this->error->getMessage(); ?></h2></div>
    
                    <div id="errorboxbody">
                        <p><?php echo JText::_('JERROR_LAYOUT_PLEASE_TRY_ONE_OF_THE_FOLLOWING_PAGES'); ?></p>
                        <a class="button-home" href="<?php echo $this->baseurl; ?>/index.php" title="<?php echo JText::_('JERROR_LAYOUT_GO_TO_THE_HOME_PAGE'); ?>"><?php echo JText::_('JERROR_LAYOUT_HOME_PAGE'); ?></a>
                    </div>
    
                </div>
            </div>
        </div>
    </div>

    Pankaj Sharma Moderator
    #1085681

    Hi
    You have to define this code

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

    after
    $theme = JFactory::getApplication()->getTemplate(true)->params->get(‘theme’, ”);
    ?>
    and change the article id with your article id.

    If any issue share site super user details and article ID in private reply.
    I will do this for you.

    Regards

    timpennington Friend
    #1085694
    This reply has been marked as private.
    Pankaj Sharma Moderator
    #1085698

    Hi
    I have not found the URL of the site in your last post.
    Kindly share it so i can check it on your site

    Regards

    timpennington Friend
    #1086135

    buddywheatley.com

    Pankaj Sharma Moderator
    #1086198

    Hi
    I added the code in error.php here: http://prntscr.com/hyso0w
    Kindly check it working fine.

    Regards

    timpennington Friend
    #1086533

    Thank you so much!

    Pankaj Sharma Moderator
    #1086671

    You are welcome!

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

This topic contains 9 replies, has 2 voices, and was last updated by  Pankaj Sharma 6 years, 3 months ago.

The topic ‘Using a 404 Error Page’ is closed to new replies.