Customizing Web Server Error Messages (Custom Error Documents)
When visitors coming to your site request pages that the web server cannot find, the web server generates and displays a standard HTML page with an error message. The standard error messages may inform of problems, but they do not usually say how to resolve them or how to get the lost visitor on his way, and they also look dull.
You may want to create your own error pages and use them on your web server. With Plesk you can customize the following error messages:
- 400 Bad File Request. Usually means the syntax used in the URL is incorrect (e.g., uppercase letter should be lower-case letter; wrong punctuation marks).
- 401 Unauthorized. Server is looking for some encryption key from the client and is not getting it. Also, wrong password may have been entered.
- 403 Forbidden/Access denied. Similar to 401; a special permission is needed to access the site – a password and/or username if it is a registration issue.
- 404 Not Found. Server cannot find the requested file. File has either been moved or deleted, or the wrong URL or document name was entered. This is the most common error.
- 500 Internal Server Error. Could not retrieve the HTML document because of server configuration problems.
To configure Plesk’s web server to show your custom error pages:
If you have a shared hosting plan, contact firstname.lastname@example.org and request that support for custom error documents be turned on through Plesk for your domain. If you have a dedicated account and have admin access to Plesk, go to your Home page, click the domain name you need, and then click Setup. Select the Custom Error Documents check box. Click OK.
If you access Plesk remotely, connect to your FTP account on the Plesk server, and go to the error_docs directory. If you access Plesk locally, go to the directory /vhosts/yourdomain.com/error_docs/.
Edit or replace the respective files. Be sure to preserve the correct file names:
- 400 Bad File Request – bad_request.html
- 401 Unauthorized – unauthorized.html
- 403 Forbidden/Access denied – forbidden.html
- 404 Not Found – not_found.html
- 500 Internal Server Error – internal_server_error.html
Wait for a few hours until your web server is restarted. After that, the web server will start using your error documents.