(see How to Upload Website Files to Plesk) or the Code Editor. visitors encounter errors on your website (such as 404 Not Found or 500 Internal Server Error). Instead of the default server error page, visitors see a page that matches your website design and provides helpful navigation.

Setting Up Custom Error Pages

  1. Log in to Plesk.
  2. Go to Websites & Domains.
  3. Click the domain name.
  4. Click Error Documents (under the Hosting & DNS section, or search for it).
  5. 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
  6. Click the error code you want to customise.
  7. 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.html from error_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.
  8. Enter the file path, URL, or message content.
  9. Click OK.

Creating a Custom HTML Error Page

To create a visually appealing error page:

  1. Open the File Manager for your domain.
  2. Navigate to the error_docs directory.
  3. Create a new HTML file (e.g., error404.html) or edit an existing one.
  4. Add your custom HTML content with your website branding, a friendly message, and navigation links back to your homepage.
  5. Save the file.
  6. 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_docs directory 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_docs directory and has 644 permissions.

"Error Documents" option is not visible:

  • Your hosting provider may have disabled this feature. Contact support.
Was this answer helpful? 0 Users Found This Useful (0 Votes)