---- Joomla Custom 404 page and Server Status Codes
cmendla - 8:09 pm on May 4, 2010 (gmt 0)
Since I am migrating my sites from frontpage to joomla, the search engines are still showing my old links. The joomla 404 page is pretty blah.
I found a tutorial at [docs.joomla.org...] which shows how to create a joomla custom 404
Four Steps to Creating a Custom 404 Error Page 1. Create an Uncategorized '404' Article
Create an 'uncategorized' article in Joomla! to serve as your 404 Page. Include some text such as Sorry, we could not find the page you were looking for... and if necessary, also any useful navigational links. For example, you may wish to add a link back to your site's home page.
2. Create and copy a link to that new 404 Article.
Create a menu item which links to the new 404 Article and 'apply' your changes. Then copy the URL information (index.php?optio...), set the menu item as 'unpublished' and close out of the menu editing page. You may want to paste the copied URL into Notepad or somewhere accessible for the time-being.
3. Copy error.php to your Template's Directory
In your Joomla! installation copy the file error.php from the templates/system directory, to your Template directory. For example, if I was using a template named 'Cleancloud' I would copy the error.php file to the templates/cleancloud directory.
4. 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:
I followed that and it shows a pretty nice 404 page that is a joomla article. HOWEVER, I tested it with an online server status code checker. It was showing as
HTTP Status Code: HTTP/1.1 302 Found
Is the 302 status code OK? I tried to change the php header command to give a 404 and that doesn't seem to work. It throws me back to the windows IE 404 page.
NOTE - the directions say to copy the error.php from the system template to the template you are using. I modified the error.php in the system template folder and that seemed to work OK. That way, if I put a new template up, then the error messages should still work.
Anyway, if the 302 is an acceptable return, then I'm done with this project and I can get on the mower and tackle part of the lawn.