Do you hate it when you have broken links on your site or that dreaded error page with the 404 message appears and it looks nothing like your website???
Well, today you're going to learn how you can change all that by simply editing one piece of code in your Joomla site.
For an example of what i'm talking about - just visit one of my sites (links in the signature) and at the end of the URL - just add some text to try and break my site - don't worry all is in order - i'm pretty sure you won't see the joomla error message. Once you've done that - return back here to continue with the modification tutorial.
To help you with this, I'm going to share with you my own error page and I'll highlight the code below you need to change in order to customize your 404 page.
But before we start doing this, you need to create an article in the article manager. Call it whatever you want and put in whatever message you want your visitors to see when they come across the broken link / error page.
Make sure you publish it the the Uncategorized section and category.
Once you've done that - download my own error page (linked below) and then change the following code in the file you've just downloaded:
/* Custom Error Page Mod Code */
if (($this->error->code) == '404') {
echo file_get_contents('PUT URL FOR YOUR NEWLY CREATED ERROR ARTICLE HERE');
}
else
{
Your URL for your error article would look something like: http://www.anisjolly.co.uk/index.php...=article&id=66 (if you've not setup SEF etc). If you have SEF enabled you'll need to figure out the URL.
Ok, we've nearly finished. Once you've done the amendment in the file, upload this amended file to the following folder in your joomla site:
templates/system/
It's as simple as that - you're all done. to test out the error page - just do what you tried to do on my site and see if your custom error page works!
If you have any problems or would like me to do this for you - just leave a message below in this thread or send me a pm and i'll be happy to help.


Reply With Quote





Bookmarks