Apache Custom Error Documents
Contents |
generic error responses in the event of 4xx or 5xx HTTP status codes, apache error document location these responses are rather stark, uninformative, and can be intimidating to site
Apache Custom Error Log Virtualhost
users. You may wish to provide custom error responses which are either friendlier, or in some language apache custom error page other than English, or perhaps which are styled more in line with your site layout. Customized error responses can be defined for any HTTP status code designated as apache custom 404 error page an error condition - that is, any 4xx or 5xx status. Additionally, a set of values are provided, so that the error document can be customized further based on the values of these variables, using Server Side Includes. Or, you can have error conditions handled by a cgi program, or other dynamic handler (PHP, mod_perl, etc)
Plesk Custom Error Documents
which makes use of these variables. Configuration Available Variables Customizing Error Responses Multi Language Custom Error Documents See alsoComments Configuration Custom error documents are configured using the ErrorDocument directive, which may be used in global, virtualhost, or directory context. It may be used in .htaccess files if AllowOverride is set to FileInfo. ErrorDocument 500 "Sorry, our script crashed. Oh dear" ErrorDocument 500 /cgi-bin/crash-recover ErrorDocument 500 http://error.example.com/server_error.html ErrorDocument 404 /errors/not_found.html ErrorDocument 401 /subscription/how_to_subscribe.html The syntax of the ErrorDocument directive is: ErrorDocument <3-digit-code>
Articles Code Recommended Most Popular .htaccess Error Documents for Beginners Apache allows you to customize the server at the directory level, using .htaccess files. This tutorial explains apache set 404 page how to use them to serve custom 404 error (page not found), apache follow symlinks and other common error pages, to your users. In Apache, you can set up each directory on your
Php Custom Error Page
server individually, giving them different properties or requirements for access. And while you can do this through normal Apache configuration, some hosts may wish to give users the ability https://httpd.apache.org/docs/trunk/custom-error.html to set up their own virtual server how they like. And so we have .htaccess files, a way to set Apache directives on a directory by directory basis without the need for direct server access, and without being able to affect other directories on the same server. One up-side of this (amongst many) is that with a few short https://www.addedbytes.com/articles/for-beginners/error-documents-for-beginners/ lines in an .htaccess file, you can tell your server that, for example, when a user asks for a page that doesn't exist, they are shown a customized error page instead of the bog-standard error page they've seen a million times before. If you visit http://www.addedbytes.com/random_made_up_address then you'll see this in action - instead of your browser's default error page, you see an error page sent by my server to you, telling you that the page you asked for doesn't exist. This has a fair few uses. For example, my 404 (page not found) error page also sends me an email whenever somebody ends up there, telling me which page they were trying to find, and where they came from to find it - hopefully, this will help me to fix broken links without needing to trawl through mind-numbing error logs. [Aside: If you set up your custom error page to email you whenever a page isn't found, remember that "/favicon.ico" requests failing doesn't mean that a page is missing. Internet Explorer 5 assumes everyone
Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site http://serverfault.com/questions/362234/apache-default-error-page About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Server Fault Questions Tags Users Badges Unanswered Ask Question _ Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The custom error best answers are voted up and rise to the top Apache default error page up vote 0 down vote favorite I have a development server and I would like to configure Apache so that when a 500 http code is generated it will display the error directly in the response (i.e. what would be printed to /var/log/httpd/error_log is displayed to the user). However, I cannot figure apache custom error out where this directive is. Any help? apache-2.2 configuration share|improve this question edited Feb 21 '12 at 14:59 Kyle Smith 7,6651730 asked Feb 21 '12 at 14:35 Thomas 112212 add a comment| 2 Answers 2 active oldest votes up vote 2 down vote Set up Apache to use server-side includes (.shtml files) and configure a custom error page as above (though naturally pointing to an .shtml file), and in that custom error page use something like this:
The requested page,
, does not work properly.
Click here to return from whence you came.
--> share|improve this answer answered Jul 14 '12 at 16:47 Lee Gee 18314 add a comment| up vote 2 down vote I believe the directive you are looking for is ErrorDocument (documented here). For example: