| Languages
Assistance
The Developer
|
|
Description
This tutorial shows you how to setup your website server to
redirect Page Not Found (404) and Access Denied (401) error
to a personalized webpage.
-
- Difficulty: Medium, Need a good understanding of file
manipulation.
-
|
Instructions
- Create a simple HTML file to test if your server accepts
404/401 redirection (A page with text that says "okay"
is sufficent).
- Now you need to create a .htaccess file. Open Notepad
or SimpleText and create a new file named "#.htaccess".
If you are using a webpage editor such as Dreamweaver create
a new file on your server named ".htaccess". Dreamweaver
users can skip step 5.
- Insert these lines into the new document and replace
the HTML URL's with your own test pages.
ErrorDocument 404 /my_404_page.htm
ErrorDocument 401 /my_401_page.htm
- Upload the test files and the "#.htaccess" file
to your server.
- Rename the file "#.htaccess" on your server.
Remove the "#" in front of the filename.
- Test if your server accepts 404/401 redirection by going
to a falsified internet URL (e.g. http://yoursite.com/doesnotexist.htm)
If your test page appears, continue this tutorial.
If a standard page not found page appears, do not continue
with this tutorial. Your website server does not support
.htaccess files.
- Now create the custom files that you will use to redirect
users. Keep in mind that a 401 Page Error is a forbibben
page and a 404 Page error is a page that wasn't found.
- Change the internet addresses as neccessary in the .htaccess
file
- Upload the files to your server.
|
| Additional Resources
|
|