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.
|