2
Ok do you know how to create a .htaccess file?
Creating A .htaccess File
Creating a .htaccess file may cause you a few problems. Writing the file is easy, you just need enter the appropriate code into a text editor (like notepad). You may run into problems with saving the file. Because .htaccess is a strange file name (the file actually has no name but a 8 letter file extension) it may not be accepted on certain systems (e.g. Windows 3.1). With most operating systems, though, all you need to do is to save the file by entering the name as:
".htaccess"
(including the quotes). If this doesn't work, you will need to name it something else (e.g. htaccess.txt) and then upload it to the server. Once you have uploaded the file you can then rename it using an FTP program.
within the file you need to write:
ErrorDocument 400 /errorfiles/000.php
ErrorDocument 401 /errorfiles/401.php
ErrorDocument 403 /errorfiles/403.php
ErrorDocument 300 /errorfiles/404.php
ErrorDocument 404 /errorfiles/404.php
ErrorDocument 500 /errorfiles/500.php
ErrorDocument 400 <-- This tells the server what error number it is.
/file-directory/000.php <-- this tells the server where the error file is located and which one to use, as you see above you can create a different error file for every error.
To include the error file within your site design you could create a php file with the following information:
include('../mainfile.php');
include('../header.php');
?>
All your error html in here, so design it how you like
include('../footer.php');
?>
As you can see in my example, I create a error page for 404, 500, and more.