Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • mpiprojects Friend
    #1092404

    Hello.

    The template redirects all 404’s back to the homepage (default Joomla behavior).
    I am trying to setup my custom error 404 page. However the error.php file in the template root directory is being ignored. Typically I should be able to edit this file in Joomla for a custom 404 page handling.

    How do I circumvent your template’s error handling? And revert back to the the normal Joomla handling through error.php?

    Pankaj Sharma Moderator
    #1092470

    Hi
    Take a look at this documentation to redirect 404 page on custom pages.
    Hope it helps

    Regards

    mpiprojects Friend
    #1092522

    Hi.

    Thanks for your reply.
    It is the approach that I took.
    The problem is that this template coding is ignoring the error.php file.
    The template has it’s own custom error handling it seems.
    So I am looking for the solution, that fix this templates error handling, so that I can use your solution on the Joomla custom error handling. But thanks anyway.

    Cheers!

    Pankaj Sharma Moderator
    #1092543

    Hi
    The errors are generated from Joomla, in the template, there is error.php file and error.css file that is used to show the error and css to style the page.

    Regards

    mpiprojects Friend
    #1093003

    Hello again.

    Thank you for your reply.
    However…
    I am using the error.php file. I can put in there whatever I want, nothing happens.
    This template is somehow bypassing the error.php file. It’s simply is not using it!
    Or some other mechanism is redirecting all 404 errors back to the homepage.
    In any case. If it is fault of the template, I would like to know. So I can fix it.
    If it is a fault on my end, I’m happy to admit that, once I would find out.
    Now I just don’t know where to start debugging on this behavior.

    I assume this template uses it’s own custom error handling. And I need it to use the regular Joomla error handling on 404 page not found. How, or more important where, can I fix this?

    Also the Joomla manual on custom error 404 page handling is not a very good approach to 404 error handling. And the use of redirecting 404 errors to a 404 page, without sending the 404 response to the browser, is kinda bad practise. The custom Joomla approach, will actually send a 200 response code to the browser instead of a 404. There is absolutely no logic in sending a 200 response on a page (that the user was looking for) that doesn’t exist.
    This will also return soft 404 errors, in for example Webmaster Tools. And that’s a sign of poor (and confusing) 404 error handling.

    Obviously it’s a discussion for another place and time. However. I just wanted to explain what I am trying to do. And what I can’t get to work in this template.

    This is what I normally put in the error.php file (of my other Joomla sites):

    if (($this->error->getCode()) == '404') {
      header("HTTP/1.0 404 Not Found");
      echo file_get_contents(JURI::root().'404');
      exit;
    }

    This would also be the best SEO approach to 404 error handling; It will send the proper browser response; And instead of redirecting to another url, it will just show the custom 404 page content inside the current url/page. It’s also more user friendly, I believe.

    Pankaj Sharma Moderator
    #1093111

    Hi
    The redirection is a suggestion by Joomla to an article page.
    You may share your idea on Joomla forum as well, so Joomla team will check it as well 🙂
    thanks for sharing.
    Regards

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

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

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