OWNCLOUD http to https redirect

Linux/Unix related issues

OWNCLOUD http to https redirect

Postby darkwiz » 08 Feb 2016 16:57

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
pain is nothing a downpour won't erase
User avatar
Site Admin
Posts: 54
Joined: 14 Sep 2012 08:50

Return to Linux/Unix

Who is online

Users browsing this forum: No registered users and 1 guest