Setting Up Custom Error Pages
- Log in to Plesk.
- Go to Websites & Domains.
- Click the domain name.
- Click Error Documents (under the Hosting & DNS section, or search for it).
- You will see a list of common HTTP error codes:
- 400 — Bad Request
- 401 — Unauthorized
- 403 — Forbidden
- 404 — Not Found
- 405 — Method Not Allowed
- 410 — Gone
- 500 — Internal Server Error
- Click the error code you want to customise.
- Select how you want to handle the error:
- Default. Uses the server default error page.
- File. Uses an HTML file from your website (e.g.,
error404.htmlfromerror_docs). - URL. Redirects the visitor to a specific URL (e.g.,
https://yourdomain.com/not-found). - Message. Displays a custom plain text or HTML message directly.
- Enter the file path, URL, or message content.
- Click OK.
Creating a Custom HTML Error Page
To create a visually appealing error page:
- Open the File Manager for your domain.
- Navigate to the
error_docsdirectory. - Create a new HTML file (e.g.,
error404.html) or edit an existing one. - Add your custom HTML content with your website branding, a friendly message, and navigation links back to your homepage.
- Save the file.
- Go to Error Documents and select File for the 404 error, then enter the path
/error404.html.
Important Notes
- Custom error pages should include a clear message, navigation links, and a way for visitors to return to your homepage.
- For 404 errors, consider adding a search bar or a link to your sitemap.
- Test your custom error pages by visiting a non-existent URL on your domain (e.g.,
https://yourdomain.com/test-nonexistent-page). - The
error_docsdirectory is automatically created by Plesk when you set up custom error pages.
Troubleshooting
Custom error page not showing:
- Clear your browser cache and try again.
- Ensure the file path in the Error Documents settings is correct.
- Check that the HTML file is located in the
error_docsdirectory and has644permissions.
"Error Documents" option is not visible:
- Your hosting provider may have disabled this feature. Contact support.