NC-18.0.6: Secure https redirect with subfolder /ncw not working


there is an issue with redirecting to secure https:

Nextcloud-18.0.6 is installed on shared webspace server in subdirectory domain.tld/ncw/

.htaccess in server root contains:

wg nextcloud-sicherheitscheck

Header set Strict-Transport-Security “max-age=15552000; includeSubDomains” env=HTTPS
Header set Referrer-Policy “no-referrer”

Diese Zeilen auskommentieren, um https- und www-Umleitung zu deaktivieren

RewriteEngine On
RewriteCond %{HTTP_HOST} !^domain.tld$
RewriteRule ^(.)$ https://domain.tld/$1 [R=301,L]
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain.tld$
RewriteCond %{HTTPS} off
RewriteRule ^(.
)$ https://domain.tld/$1 [R=301,L]

wg apple clients fuer nextcloud

Redirect 301 /.well-known/carddav /ncw/remote.php/dav
Redirect 301 /.well-known/caldav /ncw/remote.php/dav

wg Fehlermeldung ab NextCloud-v15.0.5

Redirect 301 /ocm-provider/ /ncw/ocm-provider/
Redirect 301 /ocs-provider/ /ncw/ocs-provider/

If calling domain.tld/ncw (without http: or https: in front) it redirects to unsecure
NOT https:

If calling domain.tld only (without /ncw) it redirects correctly to

If calling www.domain.tld only (without /ncw) it redirects correctly to

Tested with IE, Firefox, Opera.

Hmmmm, how to get https: redirection working in every condition?

Thanks and best regards!

Please test in ncw/config/config.php for nextcloud-setup:

‘overwriteprotocol’ => ‘https’,

Working, thank you!

1 Like