Difference between revisions of "NextCloud/Pain points/https"
< NextCloud | Pain points
Jump to navigation
Jump to search
Line 10: | Line 10: | ||
Add the following: | Add the following: | ||
− | : < | + | : <div> |
− | + | RewriteEngine On<br/> | |
+ | RewriteCond %{HTTPS} off<br/> | ||
+ | RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] | ||
+ | </div> |
Revision as of 19:07, 15 March 2021
Forcing https
It is of course strongly suggested that you always run this sort of platform behind https (so snoopers can't directly see the traffic)...
Assuming that you have an SSL cert on the domain, you'll want to redirect all http traffic to https.
This is done nice and easily, by amending the .htaccess
file in the root of the NextCloud installation.
Add the following:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]