Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

How to Set Up Custom Error Pages in DirectAdmin

When a page is missing or something goes wrong, visitors see an error page. You can replace the plain one with your own friendly message.

DirectAdmin2 min read11 steps3 screenshots

What is an error page?

Each web error has a number called a status code. A few common ones:

  • 404 means the page was not found.
  • 403 means access is not allowed.
  • 401 means a login is needed.
  • 500 means the server had an internal problem.
  • 400 means the request was bad.

A custom page can say sorry in your own words, show your logo, and link back to your home page. That keeps visitors on your site.

Method 1: the DirectAdmin tool

  1. Log in to DirectAdmin.
  2. Open Custom Error Pages. It is often in the Advanced Features area. Use the search box if you cannot find it.
    Screenshot: Open Custom Error Pages . It is often in the Advanced Features area. Use the search box if
  3. Pick the domain if the panel asks.
  4. Click the error code you want to change, such as 404.
  5. Type your message in the editor. Plain HTML works. Example:
<h1>Sorry, we cannot find that page</h1>
<p>Please go back to the <a href="/">home page</a>.</p>

This shows a heading and a link to your home page.

  1. Click Save.
  2. Test it by visiting a page that does not exist, such as yourdomain.com/no-such-page.

Method 2: .htaccess

You can also point to your own page files. The .htaccess file is a small settings file for the Apache web server.

  1. Create a file called 404.html in public_html with your message.
  2. Open File Manager and back up .htaccess.
  3. Edit .htaccess and add this line.
ErrorDocument 404 /404.html

This tells Apache to show your file whenever a page is not found.

  1. Save and test again.

Repeat for other codes, for example ErrorDocument 403 /403.html.

Tip: WordPress and some apps have their own 404 page. In that case, edit the theme's 404 template instead.

Quick recap

  • Error codes like 404 and 500 tell what went wrong.
  • Use Custom Error Pages in DirectAdmin and save your message.
    Screenshot: Use Custom Error Pages in DirectAdmin and save your message.
    Screenshot: Use Custom Error Pages in DirectAdmin and save your message.
  • Or add ErrorDocument lines to .htaccess.
  • Test with a page that does not exist.