Error Pages Tutorial
Right click on each of the below files and choose "Save Target As…" to save them to your computer.
There are no rules for editing the error page, you can do whatever you want. You can even leave it how it is. But what's the use in making an error page if it's ugly like the one I gave you?
There are a few things you may want to mention on the error page. Here are some suggestions:
- Put your email address or another way for the user to contact you on the error page. That way, they can easily get in touch with you and tell you where they found the page and help you fix broken links.
- Add links to your home page as well as a to a site map if you have one. This will help the user find the page that they want.
- You can add a script that will allow the user to go back to the last page they were at. Personally, I don't find these very useful because the user's browser already has a "Back" button they can use.
- If you are a good graphics artist, you may want to add an image on your error page.
When you are done editing this file, upload it to your domain.
Change "http://www.mydomain.com/404.htm" to the address of where the 404 page is located. You will need to change mydomain.com to your site domain. If you renamed the 404.htm file, you'll also need to change that. If the 404.htm file is in a subfolder of your domain, you'll also need to add that. For example, the link to my 404 page is:
"mydomain" changes to "coolcherrycream"
"404.htm" changes to "404.php" because the file was renamed.
Uploading and Renaming htaccess
htaccess.txt will not do anything right now. If you find a broken link in your website, you will still end up with the default error page. The file must be renamed to .htaccess before it can work.
Unfortunately, if you try to rename htaccess.txt to .htaccess while it is in your documents, it will give you an error message.
I find that it's best if you upload htaccess.txt to your website first. You probably have some sort of admin section or control panel on your website (I'd assume most people would have a link sent to them when they sign up with a web hosting service). You probably need to log in and then find some sort of file manager. Then, find the htaccess.txt file and click on it. You should get some options to rename the file and that's where you rename it to .htaccess.