Created
August 18, 2013 09:27
-
-
Save apphp-snippets/6260745 to your computer and use it in GitHub Desktop.
This example shows you how to define custom error pages in .htaccess file and also how to display the error page on your site.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sample 1: redirect errors to html files | |
ErrorDocument 400 /400.html | |
ErrorDocument 401 /401.html | |
ErrorDocument 403 /403.html | |
ErrorDocument 404 /404.html | |
ErrorDocument 405 /405.html | |
ErrorDocument 408 /408.html | |
ErrorDocument 414 /414.html | |
ErrorDocument 500 /500.html | |
ErrorDocument 502 /502.html | |
ErrorDocument 504 /504.html | |
# Sample 2: redirect errors to PHP file | |
ErrorDocument 400 /error.php?q=400 | |
ErrorDocument 401 /error.php?q=401 | |
ErrorDocument 403 /error.php?q=403 | |
ErrorDocument 404 /error.php?q=404 | |
ErrorDocument 405 /error.php?q=405 | |
ErrorDocument 408 /error.php?q=408 | |
ErrorDocument 414 /error.php?q=414 | |
ErrorDocument 500 /error.php?q=500 | |
ErrorDocument 502 /error.php?q=502 | |
ErrorDocument 504 /error.php?q=504 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment