How to enforce https for Nextcloud


Add the following code to the existing .htaccess file

RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

Best is to place it inside the block:

<IfModule mod_rewrite.c>
  RewriteEngine on
  [...]
</IfModule>

Leave a Reply

Your email address will not be published. Required fields are marked *