Redirect all requests to SSL site + Redirect to canonical domain

Hi,

Everything is working fine, however I found an issue/bug with redirects via Virtualmin:

Under Web Options for the Domain:
The Combined options for “Redirect all requests to SSL site” => “Yes”, and “Redirect to canonical domain” => “non-www to www” causing wrong redirects as follow:

Navigating to:
http : / / DOMAIN . com /
is redirecting 302 to:
https : / / www. DOMAIN . com // DOMAIN . com

The issue is, the DOMAIN name is added to the URL file path, together with a slash prefix.
The URL Path should remain as a single slash “/”.

Expected behavior:

Navigating to:
http : / / DOMAIN.com /
is redirecting 302 to:
https :// www . DOMAIN . com /

(I’m sorry for the spaces in the URL, this forum is limiting the links in the posts, even if they are just an examples)

There’s no .htaccess file under the domain.

Please see the attachments below:

SYSTEM INFORMATION
OS type and version Debian 12
Virtualmin version 7.30.8