Redirects send visitors and search engines from an old address to a new one, protecting your rankings when you restructure a site or change domains. Custom error pages keep visitors on your site when something is missing. DirectAdmin offers simple tools for both, plus full control through .htaccess.
Before you start
- Your DirectAdmin user login, with the right domain selected at the top.
- A list of old and new URLs if you are restructuring a site.
Create a redirect with Site Redirection
- Go to Account Manager → Site Redirection (in some skins under Advanced Features).
- Click Create New Redirect.
- Enter the Local URL Path, for example
/old-page, or/to redirect the whole site. - Choose the type: 301 – Permanent for moved content (best for SEO) or 302 – Temporary for short-term changes.
- Enter the Destination URL, for example
https://example.com/new-page. - Click Create.
DirectAdmin writes the rule into the domain's configuration. Delete it from the same page when no longer needed.
Force HTTPS and www
- HTTPS: in Account Manager → Domain Setup, click the domain and tick Force SSL with https redirect. See Let's Encrypt in DirectAdmin.
- www or non-www: the same page has Force Redirect options to always use
www.example.comorexample.com.
Use one method per redirect. Duplicate rules in .htaccess, plugins and DirectAdmin cause redirect loops.
Redirects with .htaccess
For patterns and many URLs, edit public_html/.htaccess with the File Manager. Redirect one page:
Redirect 301 /old-page https://example.com/new-pageRedirect a folder while keeping the rest of the path:
RewriteEngine On
RewriteRule ^shop/(.*)$ https://example.com/store/$1 [R=301,L]On servers running pure Nginx instead of Apache or LiteSpeed, .htaccess is ignored; use Site Redirection or ask your host.
Custom error pages
DirectAdmin domains include default error files in public_html such as 404.shtml, 403.shtml and 500.shtml. Edit them with the File Manager to match your design, or point Apache to your own pages in .htaccess:
ErrorDocument 404 /errors/not-found.htmlA good 404 page explains that the page is missing and links to your home page, search and popular sections. CMS platforms like WordPress generate their own 404 pages through the theme, so you only need this for static sites or folders outside the CMS.
Check your redirects
- Run
curl -I https://example.com/old-pageand look for301and theLocationheader. - Test in a private window; browsers cache permanent redirects.
Troubleshooting
- Too many redirects: two rules redirect back and forth, often HTTPS forced twice or a CDN using flexible SSL.
- 500 error after editing .htaccess: syntax error. Undo the last change and check the domain's error log under System Info & Files → Site Summary / Statistics / Logs.
- Let's Encrypt renewal fails: exclude
/.well-known/acme-challenge/from whole-site redirects.
