Custom Error Pages - II
“Page not found, please contact the administrator.” Honestly speaking, are you is going to take so much pain to call them? No! Is the most likely answer.
Better alternative is to create customized error pages, which provides satisfactory answer to visitors.
Unix/Linux servers running Apache
Apache makes use of error codes to identify various problems and errors which occur. Apache uses the .htaccess file to redirect users to custom error pages. So, you are going to need to either create or edit your sites .htaccess file.
.htaccess file? Well, it is a file that controls access to the other files within a directory. You can have just one in the main (root) directory, controlling access to your entire site, or you can have separate files in each directory. Note: Windows does not use the .htaccess system. Check first to make sure it is not there, it may just be hidden. You can chose to display hidden files and folders in your FTP client.
Creating the .htaccess file
1. Open Notepad (or equivalent software depending on your OS) and paste in the following: Error Document 404 /path/errors/404.html 2. Save the file as .htaccess (the .txt extension will be appended). 3. Upload the .htaccess.txt file via FTP. 4. Edit the file name, so that it will be .htaccess (without the .txt extension) ORYou need to add the following to the end of your .htaccess file, after any content already there : Error Document 404 /path/errors/404.html
It is important to note that you use the exact syntax above - for example ErrorDocument, not error document. You can of course change the file paths to the correct ones for your site.
Thats all. Save your file and upload it. Now your visitors will see your custom error pages, rather than the boring ones. Enjoy!
Remember! You need to create the following HTML document, which is what shown in the user’s browser: 400.html. Note : You are not limited to .html files for your error response documents (for example, you can use a .shtml file and use Server Side Includes to create customized error responses.) .jpg) |
(Posted By Simon on Wednesday, January 04, 2006)
Read All Stories
|
|
|
|