Difference between revisions of "NextCloud/Pain points/https"

From Adam Meola - wiki
Jump to navigation Jump to search
 
(2 intermediate revisions by the same user not shown)
Line 11: Line 11:
  
 
Add the following:
 
Add the following:
 +
<div style="padding-left: 20px">
 +
<pre>RewriteEngine On
 +
RewriteCond %{HTTPS} off
 +
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]</pre>
 +
</div>
  
: <pre>RewriteEngine On</pre>
+
 
: <pre>RewriteCond %{HTTPS} off</pre>
+
This will catch requests made from http, and redirect them to https.
: <pre>RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]</pre>
 

Latest revision as of 19:24, 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]


This will catch requests made from http, and redirect them to https.