The French Guy

How to redirect owncloud to https with cpanel



CPANEL redirect feature redirects both HTTP and HTTPS.
Therefore, if you try to redirect http to https , you will create a loop.

This is what CPANEL Redirect adds:
RewriteCond %{HTTP_HOST} ^your.domain.com$
RewriteRule ^/?$ “https\:\/\/your\.domain\.com\/” [R=301,L]

Edit the .htaccess of the subdomain you created for owncloud, and add at the end:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

“%{HTTPS} off” is saying if the connection is insecure, send it to https.

One Reply to “How to redirect owncloud to https with cpanel”

  1. OMG, this article just save me hours of headaches.
    Thanks a ton for sharing 🙂

Leave a Reply

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