GigaGlobe

Configuring Custom Error Pages

54 views Website Management
<h3>Creating Custom Error Pages</h3> <p>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.</p> <h3>Accessing Custom Error Pages in DirectAdmin</h3> <ol> <li>Log in to DirectAdmin.</li> <li>Navigate to <strong>Advanced Features</strong>.</li> <li>Click on <strong>Custom Error Pages</strong>.</li> <li>Select the error code you want to customize from the list.</li> </ol> <h3>Common Error Codes</h3> <ul> <li><strong>400 Bad Request</strong> - The server could not understand the request.</li> <li><strong>401 Unauthorized</strong> - Authentication is required to access the resource.</li> <li><strong>403 Forbidden</strong> - The server understood the request but refuses to authorize it.</li> <li><strong>404 Not Found</strong> - The requested page or file does not exist.</li> <li><strong>500 Internal Server Error</strong> - A general server-side error occurred.</li> </ul> <h3>Creating a Custom 404 Page</h3> <ol> <li>Create an HTML file named <code>404.html</code> (or <code>404.shtml</code>) in your <code>public_html</code> directory.</li> <li>Design the page to match your website's look and feel. Include helpful elements such as: <ul> <li>Your website logo and navigation menu.</li> <li>A friendly message explaining the page was not found.</li> <li>A search bar to help visitors find what they need.</li> <li>Links to your homepage and popular pages.</li> </ul></li> <li>In DirectAdmin's Custom Error Pages section, select the <strong>404</strong> error.</li> <li>Enter the path to your custom page or paste the HTML content.</li> <li>Click <strong>Save</strong>.</li> </ol> <h3>Using .htaccess for Custom Error Pages</h3> <p>You can also configure custom error pages via your <code>.htaccess</code> file:</p> <pre><code>ErrorDocument 404 /404.html ErrorDocument 403 /403.html ErrorDocument 500 /500.html</code></pre> <div class="alert alert-info">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.</div> <div class="alert alert-warning">Keep your custom error pages simple and lightweight. Avoid relying on external resources or complex PHP scripts that might themselves cause errors.</div>
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?