Setting Error Pages
Setting error pages using .htaccess is easy. Just add the
following code to your .htaccess file:
#
# Set the location of the error pages
#
ErrorDocument 400 /400.shtml
ErrorDocument 401 /401.shtml
ErrorDocument 403 /403.shtml
ErrorDocument 404 /404.shtml
ErrorDocument 500 /500.shtml
However, you may encounter problems with that configuration if
you use it with other .htaccess code snipets on this website (expessaly the one that blocks bad bots
and null useragents). In that case, add the following to your .htaccess (please note that
this requires you to have mod_rewrite installed) above all your rewrite statements:
<Files 403.shtml>
RewriteEngine On
RewriteRule ^.* - [L]
</Files>
If you blocking ip addresses and/or other things using
deny from statements in your .htaccess file, add this code before all the deny from statements:
<Files 403.shtml>
allow from all
</Files>
Back
|