DirectAdmin’s built-in handling of HTTPS and www redirects can unintentionally cause security warnings and reduced test results, even when a website itself is correctly configured. This is not caused by user error or misconfigured .htaccess files, but by how DirectAdmin applies redirects at server level.
This affects:
When DirectAdmin’s “Force SSL” and/or www redirection options are enabled, visitors often encounter this redirect chain:
http://example.com/ → 301 https://example.com/ → 301 https://www.example.com/ → 200 OK
From a browser’s perspective, these are separate external redirects. Each redirect is a new navigation and a new response.
The Strict-Transport-Security (HSTS) header tells browsers to always use HTTPS for a specific hostname. However:
In the DirectAdmin redirect chain, the first HTTPS response is often:
https://example.com/ → 301 → https://www.example.com/
If this 301 response does not include HSTS, the browser does not learn an HSTS policy for example.com, even if the final destination (https://www.example.com/) includes it.
Many users try to fix this by adding security headers in .htaccess, for example:
Header always set Strict-Transport-Security "max-age=63072000; includeSubDomains"
However, testing shows that the redirect from https://example.com/ to https://www.example.com/ is handled before .htaccess is processed.
If a redirect is executed before .htaccess, then:
.htaccess rules are never executedHeader always set cannot workThis is an execution-order issue, not a configuration mistake.
Security scanners such as internet.nl test the exact hostname provided by the user. If https://example.com/ responds with an HTTPS redirect that lacks HSTS, the correct conclusion is:
This webserver does not offer an HSTS policy.
This matches real browser behaviour and is not a false positive.
A website can be technically correct and still appear insecure due to hosting platform behaviour.
From a browser and security perspective, the technically preferred approach is a single external redirect that enforces HTTPS and the canonical hostname in one step:
http://example.com/path → 301 https://www.example.com/path
Multiple redirects are technically valid, but they increase complexity and can cause missing security headers on intermediate responses.
Because these redirects are generated at server level and executed before user configuration, site owners cannot fully resolve this themselves. Security headers must be applied at the same level where the redirect is generated.
Key takeaway:
A website can be correctly configured and still appear insecure if the hosting platform applies redirects before user-level security headers are executed.