This article will explain how a 404 redirect to index.php in Joomla 1.5.x

This can be useful if used as components sh404SEF or if you use custom page errore404 [Zip Archive – 1.73 MB]

Let us now make the change by:
vostrosito.it / templates / system / error.php

or if you have already used the page errore404 the change needs to be done in
vostrosito.it / templates / vostrotemplate_XXX / error.php

Open the file for editing error.php line 14 and line 22 as follows, of course it does not copy the number 14 nor the 22, but only the text that follows.

/ / No direct access
defined (‘_JEXEC’) or die (‘Restricted access’);
Line 14 header ("Location: /"), exit ();
?>
<! 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;? ">
<head>
<title> <? php echo $ this-> error-> code?> – <? php echo $ this-> title;?> </ title>
<Link rel = "stylesheet" href = "<? Php echo $ this-> baseurl;?> / Templates / system / css / error.css" type = "text / css" />
Line 22 <meta HTTP-EQUIV="REFRESH" content="0; url=/index.php">
</ Head>

in the end saved the file and call your website in the browser you use (Explorer, Firefox, etc. ..) enter a page that does not exist as such vostrosito.it / dhfwodsk if everything went well you will see the index of your website.

Always perform a backup of the file to be edited prior to each test or direct editing on the server.

Or who can use the. Htaccess file uses Apache is therefore simply write

  • ErrorDocument 404 / index.php

in the file. htaccess