Managing Custom Error Pages in DirectAdmin
Summary
This guide explains how to create and manage custom error pages in DirectAdmin. Custom error pages replace the default server messages for common HTTP errors such as 404 (Not Found) or 500 (Server Error).
Overview
Custom error pages improve user experience by providing branded, helpful messages instead of generic server responses. DirectAdmin allows you to edit and customize these pages directly from the control panel.
Requirements
- DirectAdmin user-level access
- A domain hosted on the server
- Basic HTML knowledge (recommended)
Step-by-Step Instructions
1. Access Custom Error Pages
- Log in to DirectAdmin
- Go to Advanced Features → Custom Error Pages
- Select the domain you want to manage
2. Choose an Error Page to Edit
Common error codes include:
- 401 Unauthorized
- 403 Forbidden
- 404 Not Found
- 500 Internal Server Error
Click the error code you want to customize.
3. Edit the Error Page
- A text editor will appear
- Add your custom HTML, text, or styling
- Click “Save” when finished
Example 404 Page:
<html>
<head><title>Page Not Found</title></head>
<body>
<h1>Oops! This page doesn’t exist.</h1>
<p>Please return to our homepage.</p>
</body>
</html>
4. Restore Default Error Page
If you want to undo your changes:
- Open the error page again
- Delete your custom content
- Save the file to revert to the default server message
5. Location of Error Pages
Custom error pages are stored in:
domains/yourdomain.com/public_html/
They are typically named:
- 401.html
- 403.html
- 404.html
- 500.html
Troubleshooting
Custom Error Page Not Showing
- Ensure the file is saved correctly
- Clear your browser cache
- Check .htaccess for conflicting rules
- Make sure the file permissions allow public access (644 recommended)
404 Page Still Shows Default Server Message
- Confirm the file is named 404.html
- Ensure the file is in the correct directory
- Check for redirects that may override error handling
500 Error Page Not Displaying
- A broken .htaccess file may prevent custom pages from loading
- Fix the .htaccess issue first, then test again
Styling Not Loading
- Ensure CSS files are referenced with absolute paths
- Example: /styles/main.css instead of styles/main.css
Related Articles
- Directory Password Protection
- Apache Handlers
- MIME Types
- PHP Settings
- Cron Jobs