Start a conversation

How to set custom 404 page in joomla

Joomla is a CMS which is an easy to use content management system that is developed in PHP to keeps track of every piece of content on your Web site. It Also supports features which enables you to build Web sites and powerful online applications. Joomla is an open source solution that is freely available to everyone and developed in PHP scripting language with MySQL database support. A major advantage of using Joomla as a CMS is that it requires almost no technical skill or knowledge to manage. Joomla is a free and open source content management system (CMS) for publishing content on the World Wide Web and intranets and a model–view–controller (MVC) Web application framework that can also be used independently. It is a platform which uses cPanel hosting server to host sites developed in Joomla.

Now lets see how to create 404.shtml file under the document root then open the error.php file

vi /home/username/public_html/templates/system/error.php
then add the following code below the line “defined( ‘_JEXEC’ ) or die( ‘Restricted access’ );”
if (($this->error->code) == ‘404’) {
echo file_get_contents(‘http://www.domain.com/404.shtml’);
}
else
{
And then add the following code at the end of error.php file
<?php
}
?>

Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Diya Ahmed

  2. Posted

Comments