No matter whether you are a geek or simply a normal internet user, there are times when you come across dead links within a website. And that pretty much annoys you. And half of the time you decide to move on and go to other websites.
To the webmaster/web owner, this is a downright frustration as well because you loses traffic. But maybe you do not realise that the reason why your visitor decides to leave your website not because they can’t access the page (well, that’s half of the reason of course) but because they’re being rubbed in the face with the ugly ERROR page.
So, to make sure the visitors will still stay on your website, you need to spiff up your error pages. What do we do?
Obviously, we will need to customise the error pages. To do this, you will have to create a file called .htaccess. If you already have this file, you only need to add in a couple of lines.
Anyway, if you hadn’t, follow the steps below.
Create a file that serves as your error page. You can customise it in anyway you like. Add in CSS, Flash, it is up to you. Save it as 404.html. (You can choose to save it as .php file instead of .html if you like).
Open up your editor (eg. Notepad) and type in these lines:
ErrorDocument 404 http://www.yourwebsite.com/404.html
Save the file as htaccess.txt.
* If you had chosen to name the file as 404.php, make sure in the lines above you use the same extension as well.
Upload the two files (404.html, htaccess.txt) to the root folder of your website and rename htaccess.txt as .htaccess.
Test the error pages by typing in your web address URL followed by garbled/random words, for example: http://yourwebsite.com/ilurveyou. The error pages that you created just now should be displayed. If it doesn’t, do give me a buzz.