how to force the use of HTTPS?

Ask all your questions regarding OC 5.x Please read the Support Forum Rules
Forum rules
ownCloud 5.x reached end of life and is officially unsupported. For details see Wiki page.

Please upgrade your ownCloud.
ovidiu
Beginner
Posts: 44
Joined: Sun Jun 24, 2012 10:16 pm

how to force the use of HTTPS?

Postby ovidiu » Sun Jul 08, 2012 11:39 pm

I tried editing the .htaccess file and inserted these lines right after

Code: Select all

RewriteEngine on


Code: Select all

RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}


since that resulted in a redirect loop (yes I emptied my browser cache)

I then tried this:

Code: Select all

RewriteRule ^.*$ https://%1/$1 [R=301,L]


but that also gave me a redirect loop.

Can someone please explain how to force OC to use HTTPS via .htaccess?
Environment: Debian 6.0.5
Server: own root server
Database: MySQL 5.1.63
Client: MAC Lion
OC-Version: 4.0.4
PHP-Version: 5.3.3-7+squeeze13

Richie
Beginner
Posts: 13
Joined: Fri Jun 15, 2012 3:18 am

Re: how to force the use of HTTPS?

Postby Richie » Mon Jul 09, 2012 3:41 am

Good day!

In my case, what I did was I edit the file which is ".htaccess" following the path "/var/www/html/owncloud/.htaccess" and inserted the lines:

RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}


after the line :


RewriteEngine on



Also, make sure you have something as follows in httpd.conf (mod_rewrite support):
LoadModule rewrite_module modules/mod_rewrite.so


I got this idea in http://www.cyberciti.biz/tips/howto-apache-force-https-secure-connections.html
You can check it out, but start in the topic "Force webmail login over SSL https session"

I hope that can help :D

ad2012
Beginner
Posts: 23
Joined: Thu Jun 28, 2012 10:56 pm

Re: how to force the use of HTTPS?

Postby ad2012 » Mon Jul 09, 2012 9:24 am

For me, adding

Code: Select all

"forcessl" => true,

to my config.php did the trick :)

ovidiu
Beginner
Posts: 44
Joined: Sun Jun 24, 2012 10:16 pm

Re: how to force the use of HTTPS?

Postby ovidiu » Mon Jul 09, 2012 9:34 am

Code: Select all

"forcessl" => true,
did the trick for me, thank you very much :-)
Environment: Debian 6.0.5
Server: own root server
Database: MySQL 5.1.63
Client: MAC Lion
OC-Version: 4.0.4
PHP-Version: 5.3.3-7+squeeze13

ad2012
Beginner
Posts: 23
Joined: Thu Jun 28, 2012 10:56 pm

Re: how to force the use of HTTPS?

Postby ad2012 » Mon Jul 09, 2012 9:37 am

ovidiu wrote:

Code: Select all

"forcessl" => true,
did the trick for me, thank you very much :-)

A better documentation would be great :)
But there is a sample config.php where to find a couple of nice settings!

Karaoko
Beginner
Posts: 10
Joined: Sat Jun 09, 2012 11:41 pm

Re: how to force the use of HTTPS?

Postby Karaoko » Mon Jul 09, 2012 9:02 pm

where is the sample config.php ?

ovidiu
Beginner
Posts: 44
Joined: Sun Jun 24, 2012 10:16 pm

Re: how to force the use of HTTPS?

Postby ovidiu » Mon Jul 09, 2012 9:47 pm

@Karaoko: its inside your config folder, named config.sample.php

@ad2012: thx for the hint. I had not looked into the sample config file because usually the sample is copied/renamed into the proper file and things are just commented, it had never occurred to me to think there was more stuff in the sample file than in the live config file :-)
Environment: Debian 6.0.5
Server: own root server
Database: MySQL 5.1.63
Client: MAC Lion
OC-Version: 4.0.4
PHP-Version: 5.3.3-7+squeeze13


  • Similar Topics
    Replies
    Views
    Last post

Return to “ownCloud Community Edition 5.x and older”

Who is online

Users browsing this forum: Bing [Bot] and 0 guests