Web Hosting Canada Logo

 

How to use .htaccess files to control your 404 Page Errors

 

 

Firstly, .htaccess files will only operate on Linux based hosting plans.

If you have a Windows based hosting plan, custom 404 configurations are possible however they must be performed by WeDoHosting.com Web Site Hosting staff. Please contact support@wedohosting.com if you need that help. Windows 404 setup charge is $15.00 plus GST.

IF YOU ARE USING FRONT PAGE please contact support@wedohosting.com prior to making any changes to your existing .htaccess file as it will break your Front Page extensions if not done correctly.

Now, back to Linux users. The .htaccess file is really a VERY simple tool/file that can be done using any text editor - such as notepad for Windows. Although there are literally dozens of advance possible .htaccess configuration probabilities, we will focus on the 404 page syntax and file first.


So, open up your text editor and type in the following:

ErrorDocument 404 /error.htm

Let us describe this.

  • ErrorDocument - Must be spelled exact ally like that and have the upper and lower case letters followed.


  • 404 - describes the "type" of error - in this case, 404 is globally recognized as "File not Found"


  • Then, we have a single space followed by the file name that you would like to redirect the visitor to. In this base I have selected /error.htm - indicating to look in the "root" folder (htdocs) for a file named "error.htm"

Alternately you could redirect the visitor to any page you wanted, or even outside of your site by substituting a full URL as the error page - such as this:

ErrorDocument 404 http://www.bob.com


So there it is - one line with so much power.

Now, the important part to making this all work.

A: The file MUST be saved as .htaccess - just like that - not .htaccess.txt or any other variation. You can do this in notepad by choosing "File -> Save As" - then in the "Save as type" - dropping down the menu and choosing "All Files" - and calling the file name .htaccess

B: Now, in order to get this to the server, use your FTP program and MAKE SURE that the file is uploaded in ASCII format - not "Binary"

So, try it out by going to your web browser and typing in a "nonexistent" file name and see if the redirect works. If you have chosen the /file.htm format and you find it is not working for you, replace that with the http://domain.com/file.htm format first.

If you get an error that complains about the server not being able to process the request, please double check that you have used ASCII format to upload the file.

If you are not a WeDoHosting.com customer, please review our hosting options from the menu below and consider moving your web site hosting to us.

 

 

Proudly Providing Web Hosting From Canada, For The World.

Web Hosting Services From Canada

WeDoHosting Canada: Virtual Web Hosting | Dedicated Servers | Server Colocation | Ecommerce Hosting | Specials
Linux Web Hosting: Linux | Dedicated Servers | High Storage | Virtual Dedicated Servers
Windows Web Hosting: ASP.Net | ColdFusion | Dedicated Windows Servers
Additional Services: Email Only Web Hosting | Managed Services | Private Label Hosting | Affiliate Program | Canada Domain Registration | Value Added Services | Canada-based Hosting Services | Premium Packages | Website Templates
Regional: Main | Canada | US

WeDoHosting Canada Corporate Information:
WeDoHosting Canada Home | Contact Us | Award Winning | Services Map | Online Resources | Internet Resources | Facilites in Canada | Privacy Policy | Large File Sending

 

©Copyright 1999-2009 WeDoHosting.com Inc. All Rights Reserved. WeDoHosting.com is a Trademark of WeDoHosting.com Inc. All other marks are the property of their repective owners.

WeDoHosting's SEO for "web hosting canada", and more provided by
Beanstalk Search Engine Optimization, Inc.

WeDoHosting.com Inc. #101-4226 Commerce Circle, Victoria BC Canada V8Z 6N6
Phone: 1-250-479-1595 Toll Free: 1-888-647-9336 Fax: 1-250-479-1517
A Division of FroZen Dirt Media Corp.

Terms of Service and Acceptable Use Policy