Force HTTPS and choose www
Enable redirection only after a certificate has been issued for every name in use.
DirectAdmin redirect
- Open Account Manager → Domain Setup.
- Select the domain.
- Enable Force SSL with HTTPS redirect or Force Redirect.
- When available, choose www, non-www or keep the current host.
- Save and test several URLs.
DirectAdmin's server-level redirect is preferable to another .htaccess rule because it runs earlier and reduces conflicts.
www or non-www
Both are valid. Choose one canonical address and redirect the other to it. DNS and the certificate must cover both names when visitors may use both.
Redirect loops
Enforcing HTTPS simultaneously in DirectAdmin, WordPress, a plugin, a CDN and .htaccess can cause Too many redirects. Keep one primary rule and check the CDN's connection mode.
Test
http://example.comshould reach the chosen HTTPS address.http://www.example.comshould reach the same canonical version.- The redirect must preserve a path such as
/contact. - Administration and forms must work without a loop.
public_html and private_html
Store the website for both HTTP and HTTPS only in public_html. On Euroserver systems, private_html is a symbolic link to public_html and is no longer used separately. Do not maintain a second website copy there.