Custom 404 Page
In this tutorial we will create a custom 404 page. A 404 error is when someone tries to access a page that does not exist. A good example of a custom 404 error page is the one Yahoo! has. www.Yahoo.com/wrongURL.
There is more than one way to create your custom error page. One way you could do it is though cPanel. In this tutorial we will create our page with some HTML, save it as 404.shtml , upload through FTP, and we're done.
This will not be the prettiest of 'error pages', because we will not be using any CSS, just some basic HTML. When you create your own 404 error page, you may put inline CSS styles, an example is below. Or you could even specify your external CSS stylesheet.
The code below will begin our error page. Keep in mind that we will save the file as 404.shtml.
<head>
<title>Error</title>
</head>
</head>
<body>
<h3 align="center">404 Error</h3>
<p align="center">The page you requested does not exist. Please check if you have correctly typed the URL in the address bar.</p>
</body>
</html>
There we have it, some simple HTML. We can also give the visitor some info about the request, his/her browser, and IP. Below are the codes.
The Referring URL: <!--#echo var="HTTP_REFERER" -->
The IP address: <!--#echo var="REMOTE_ADDR" -->
The Requested URL: <!--#echo var="REQUEST_URI" -->
The Browser: <!--#echo var="HTTP_USER_AGENT" -->
Just stick those codes in where you want them, and it should display the visitors info. After you are finished you can view the HTML file on your desktop, then upload it as 404.shtml to your website through an FTP client. I recommend using FTP surfer as an FTP client.
If you need any help, please ask on the Forums.