Support Centre

How to add custom 404 error pages

4*4*4*4*4*

Article

Note: This guide is intended for use on our Linux platform only

Have you ever been browsing a website and selected a broken link, or mistyped a URL and instead of a generic error page, you have been presented with an error page which has the sites logo, and maybe a message from the company explaining why you can't view that page - these are custom error pages.

It is a fairly simple process to create your own custom error page. First of all, you need to create a file on your computer called '.htaccess' - You can use a simple text editor such as 'notepad' to create this file, but just ensure when saving the file that you do not save it as a .txt file - the filename must be '.htaccess'

Add the following code to your newly created .htaccess file:-

<Files .htaccess>         
order allow,deny         
deny from all         
</Files>    

ErrorDocument 404 /errordocs/error404.htm

*/errordocs/error404.htm simply refers to the location of your custom error page that you must create. You do not have to use this directory path, or file name, this is simply an example.

Now you have your .htaccess file, you need to create a custom error page - For this I would recommend creating a page which uses the same styling as the rest of your site, with a message explaining that the page the user is looking for doesn't exist (although it can say anything you want!) - Save this file as 'error404.htm'

Now using your preferred FTP software, or File Manager, upload the '.htaccess' file to the /web directory of your hosting account, and your custom error page 'error404.htm' to the /errordocs/ directory (you will need to create this directory if it doesn't already exist)

All that's left to do now is test your custom error page, try entering your site URL in to the address bar of your browser with a spurious page name afterwards, for example http://www.yourdomain.com/ugdriogh.htm - You should now see your custom error page!

Rate This Article

How useful was this article?

Not useful A little useful Useful Very useful Everything I needed