Page 1 of 1

OWNCLOUD http to https redirect

Posted: 08 Feb 2016 16:57
by darkwiz
Edit httpd.conf

Code: Select all

#Listen 443
#uncomment and change the above only for other ports

RewriteEngine on
ReWriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L]

SSLEngine on
SSLCertificateFile /etc/apache2/ssl/owncloud.pem
SSLCertificateKeyFile /etc/apache2/ssl/owncloud.key
DocumentRoot /var/www/owncloud/

Alias /owncloud "/var/www/owncloud/"
<Directory "/var/www/owncloud">
    Options +FollowSymLinks
    AllowOverride All

    <IfModule mod_dav.c>
      Dav off

    SetEnv HOME /var/www/owncloud
    SetEnv HTTP_HOME /var/www/owncloud

<Directory "/var/www/owncloud/data/">
  # just in case if .htaccess gets disabled
  Require all denied