htaccess custom error documents
The htaccess gives you the ability to redirect the visitor to different pages if they try to access an invalid page. You can use a custom error page for any type of error as long as you know its number. using custom error page helps lot to increase the performence in Search Engine Optimizaton.
To know detailed http error codes refer to my previous post.to work out this you need to add these htaccess command to your httaccess file and include in your server root folder.
To know how to user htaccess file please refere to my previouse post.
Example: 404 Page Not Found. The layout for this command is :
ErrorDocument errornumber /filename.html
So if you create a page called NotFound.html and you wanted to use it as the 404 error page, the command would be :
ErrorDocument 404 /NotFound.html
If you want to keep all of the error pages in a separate directory, just include the directory name in the file path :
ErrorDocument 404 /errorpages/NotFound.html
The most used error documents are :
400 Bad Request A generic kind of error that people get into by doing some strange stuff with your URL or scripts.
401 Authorization Required When someone tries to enter a protected area without proper authorization.
403 Forbidden When a file with permissions not allowing it to be accessed by the user is requested.
404 Not Found Kinda obvious.
500 Internal Server Error This may help you with internal server errors in any scripts you have running.
There are many others, To view complete http error code see my previous post.
Popularity: 1% [?]

