Configuring Custom Error Pages

8 views Website Management

Creating Custom Error Pages

Custom error pages replace the default server error messages with your own branded pages. This provides a better user experience when visitors encounter errors on your website such as broken links or server issues.

Accessing Custom Error Pages in DirectAdmin

  1. Log in to DirectAdmin.
  2. Navigate to Advanced Features.
  3. Click on Custom Error Pages.
  4. Select the error code you want to customize from the list.

Common Error Codes

  • 400 Bad Request - The server could not understand the request.
  • 401 Unauthorized - Authentication is required to access the resource.
  • 403 Forbidden - The server understood the request but refuses to authorize it.
  • 404 Not Found - The requested page or file does not exist.
  • 500 Internal Server Error - A general server-side error occurred.

Creating a Custom 404 Page

  1. Create an HTML file named 404.html (or 404.shtml) in your public_html directory.
  2. Design the page to match your website's look and feel. Include helpful elements such as:
    • Your website logo and navigation menu.
    • A friendly message explaining the page was not found.
    • A search bar to help visitors find what they need.
    • Links to your homepage and popular pages.
  3. In DirectAdmin's Custom Error Pages section, select the 404 error.
  4. Enter the path to your custom page or paste the HTML content.
  5. Click Save.

Using .htaccess for Custom Error Pages

You can also configure custom error pages via your .htaccess file:

ErrorDocument 404 /404.html
ErrorDocument 403 /403.html
ErrorDocument 500 /500.html
Paths in ErrorDocument directives are relative to your document root. Ensure the error page files exist at the specified paths or visitors will see a plain text error instead.
Keep your custom error pages simple and lightweight. Avoid relying on external resources or complex PHP scripts that might themselves cause errors.
Need More Help?

Can't find what you're looking for? Our support team is ready to help.

Contact Support
Hi there! How can we help?
Chat with us