How to create a custom error page (404) for Joomla 1.6?

How to create a custom error page (404) for Joomla 1.6?

I tried the tutorial (http://docs.joomla.org/Tutorial:Create_a_Custom_404_Error_Page), but it does not work for 1.5.

Thanks.

+3
source share
3 answers

A call → code is a call to a protected property, which is no longer possible. You must use getCode (). Fixed code for 1.6:

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

Now it works for Yoomla 1.6. (as a fix for Example 1.5 at http://docs.joomla.org/Creating_a_Custom_404_Error_Page - the rest of this page is accurate)

+1
source

I think I would solve this with a more traditional approach and just edit the .htaccess file.

I think this is also a search engine based approach.

For some ads

0
source

Just follow these steps:

  • Create a category (without a heading) (see if it does not already exist by default)
  • Create article
    • Title: 404
    • Category: Uncategorized
    • Article Content: Opps, Page Not Found (or Something Else)
  • Create hidden menu
    • Menu → Menu Manager
    • Title: Hidden, Menu Type: Hiddenmenu
  • Create a menu item inside this hidden menu
    • Menu Type: Single Article
    • Title: Page not found.
    • Alias: Page not found
    • Template: your template that you want to use to show that the page was not found
    • Link to article: to the article that you created in our case 404
    • Robots: no index; no follow (for google to avoid indexing this page)
  • Then add this piece of code to your joomla error.php file, you may find that inside (root_directory) \ templates \ system \ error.php

     defined( '_JEXEC' ) or die( 'Restricted access'); if ($this->error->getCode() == '404' ) { header('Location: http://www.domain.com/page-not-found'); exit;} 
0
source

Source: https://habr.com/ru/post/1342760/


All Articles