Customized 404 Not Found Page for your website

A 404 error is the response given by the web server when we try to open a page on the internet that does not exist.

If you don’t specifically tell your web server how to handle 404 errors, it will serve up a very plain and generic looking error page. That just says something like “Not Found – The requested URL was not found on this server.” on a plain white page.”

normal

A 404 page should look like an error page, but it should still look like your website. If you are using a CMS, this is probably already handled for you. If you have a static site, you can specify a 404 template through your .htaccess file.

– source http://css-tricks.com/


Here is how you make your custom 404 page :

Step 1:

Suppose your Web-project folder is xampp/htdocs/test

Create a new text document in your website’s folder.

Type the following inside the text file:

ErrorDocument 404 /test/error404.php

Save the file as .htaccess

Step 2:

Next create the error404.php page in the path specified above, i.e. in the test folder in this case.

This is the page which will be shown instead of the normal 404 error page.

Sometimes there might be some Webserver issues which can be rectified as follows :

A directive should be added to your httpd.conf for the directory which your website lives in. Let’s say for this example it’s /www/htdocs. Here’s a line in your httpd.conf that you must have for this .htaccess file to work:

<Directory /www/htdocs/yoursite>
AllowOverride FileInfo
</Directory>

– source http://www.devarticles.com/

modified

Good read : http://css-tricks.com/404-best-practices/

Dedicated to X[a]T!, Os!r!S & KenSe! for their constant effort in reducing the load on Mother Earth.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: