Booked Scheduler Community Support
November 15, 2018, 03:43:35 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Booked 2.7 beta has been released!
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: Issue with https redirect  (Read 218 times)
dvandergeld
Newbie
*

Karma: 0
Posts: 2


« on: September 14, 2018, 10:42:05 AM »

Good Morning,

I have been using booked for some time now. But somehow I can't manage to make it run via https. I hope someone can help me with this, I haven't found the answer elsewhere in this forum.
I'm using the latest version of booked (2.7), but this problem also applies to earlier versions (I have tried 2.5 for instance). I use a hosting provider, so I'm not maintaing the webserver myself.
I have replaced my real domain name with domain.com

After installation, booked works great. It doesn't matter if I use http of https, it works either way.
If I use .htaccess to force a https redirect it doesn't work anymore. It has something to do with redirections. IE/Edge says: "Can't reach this page. There were too many redirections.
Error Code: INET_E_REDIRECT_FAILED"
Firefox says: "The page isn't redirecting properly"
Chrome says: "ERR_TOO_MANY_REDIRECTS"

At this point I leave out the https in my config file, but I have also tried it with http and https.
$conf['settings']['script.url'] = 'kalender.domain.com/Web';

My .htaccess contains the following:
-----------------------------------
RewriteEngine On
# Set RewriteBase if your physical path is different from the URL. For example, if using an alias

# Uncomment the following two lines to force HTTPS
RewriteCond %{HTTPS} off
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteRule ^Web - [L,NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ Web/$1 [QSA,L]

---------------------------

I have the same problem when hosting it on https://domain.com/kalender instead of https://kalender.domain.com

I can't figure out why this doesn't work. Can anyone help me? Or help me on the right path? In this day and age I don't want to use http anymore.
Thanks in advance!
Logged
nwpro
Full Member
***

Karma: 0
Posts: 171


« Reply #1 on: September 14, 2018, 11:50:23 AM »

1. Does just a regular file redirect properly?  For example, create a test.html file.  If you go to: domain.com/test.html does it redirect to: https://domain.com/test.html?  What this is doing is ensuring your htaccess file is set properly.

2. Make sure there isn't another .htaccess in the directory prior.  Depending on how they are written, they can stack from directory to directory.

3. In config, try putting // in front of your script.url:  //kalender.domain.com/Web

Logged
dvandergeld
Newbie
*

Karma: 0
Posts: 2


« Reply #2 on: September 14, 2018, 04:47:57 PM »

Thanks for the reply

It turned out that a test html file also didn't work. So there was a problem with my .htaccess
So I Googled that. After reading some documentation, I changed the content of my .htaccess to:

RewriteEngine On
RewriteCond %{ENV:HTTPS} !on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

This did the trick. I don't know why exactly...

Anyway, thanks for helping me! kudos to nwpro
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.20 | SMF © 2006-2007, Simple Machines Valid XHTML 1.0! Valid CSS!