-
AuthorPosts
-
October 3, 2013 at 12:47 pm #191129
Hi,
I need help changing the contents and picture of the 404 Error page.
I know this has already been covered here but the information on the previous thread was a bit too advanced for me as I am a very basic user.
I have located the source PSD File which allows me to change the images and text on the 404 page but I think there’s more too it than that, such as changing php files through cpanel and/or back end.
If someone could walk me through step by step how to change the image and text and make a basic link back to a page of my choice I would be very grateful.
Regards,
Adam
TomC ModeratorTomC
- Join date:
- October 2014
- Posts:
- 14077
- Downloads:
- 58
- Uploads:
- 137
- Thanks:
- 948
- Thanked:
- 3155 times in 2495 posts
October 3, 2013 at 3:49 pm #507927Perhaps the following video tutorial may be of assistance . . . .
TomC ModeratorTomC
- Join date:
- October 2014
- Posts:
- 14077
- Downloads:
- 58
- Uploads:
- 137
- Thanks:
- 948
- Thanked:
- 3155 times in 2495 posts
October 3, 2013 at 3:57 pm #507928otherwise, the following is a helpful step-by-step tutorial – courtesy of OSTraining.org
By default, Joomla does not provide a 404 page that you can easily create and manage.
A 404 is really useful for guiding your visitors when they visit a broken URL on your site.
I’m going to demonstrate how to create a custom 404 page.
We’re going to create an article, add a menu link and then add a little code to a file in your template folder.
Step 1: Create an article
The first step in creating a custom 404 page is to create a new article.- Title: Create something that is specific to Error 404 since it may be displayed as your browsers title bar.
- Alias: Type in a simple alias, such as 404.
- Category: You can use Uncategorised or create another category.
- Article Text: Add your 404 image or text, or design it however you’d like. In this example, I made my own funny 404 image.
Step 2: Edit Metadata Options
- On the same article, look at the right column and click on the “Metadata Options” tab.
- Select “No index, no follow” to prevent this particular page to be indexed in search engines.
- Save and Close.
Step 3: Create a Hidden Menu
You can view our tutorial on how to create a Hidden menu here.- Menu Item Type – Select your Error 404 Page article.
- Menu Title – Anything you’d like, such as Error 404 Page.
- Alias – Type in a simple alias, such as 404.
Make sure this menu is not published in a module position so it is not displayed.
Step 3: Copy the Link
Copy the URL from your menu and store it on a notepad since you will be using this URL in your error.php file.Step 4: Edit the error.php File
Find your error.php file.Usually it is located in “templates/YourTemplate/system/error.php” or in “templates/YourTemplate/error.php”.
If you don’t have an error.php file, create it in this folder: templates/YourTemplate/error.php.
Please make sure that you have this security code at the top of the file:
1.defined( ‘_JEXEC’ ) or die( ‘Restricted access’);Now we need our 404 page code.
For Joomla 2.5 use this code:
1.if ($this->error->getCode() == 404) { header(‘Location: /theURLtoYour404Page’); exit; }For Joomla 3.0 use this code:
1.if ($this->error->code == 404) { header(‘Location: /theURLtoYour404Page’); exit; }Step 5: Test Your 404
Type in a URL such as yoursite.com/blahblahblah to be redirected to your custom 404 page.In this example, I used my 404.jpg file. As you can see, I’m not much of a graphic artist, but it gets the point across.
Congratulations! You now know how to create custom 404 pages.
-
AuthorPosts
This topic contains 3 replies, has 2 voices, and was last updated by TomC 11 years, 1 month ago.
We moved to new unified forum. Please post all new support queries in our New Forum