Forcing HTTPS not possible on Bludit?

franckfriends
Jr. Bludit
Posts: 6
Joined: Tue Mar 14, 2017 12:22 pm

Hi

I'm trying to force HTTPS on a Bludit site with the edition of the htaccess but only on the Bludit site I get a "redirected you too many times" error.

Even a PHP solution gave the same result.

Is there a solution to force HTTPS on a Bludit site without causing endless redirections?

Thanks!
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

Can you please post your .htaccess.
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
User avatar
diego
Site Admin
Posts: 773
Joined: Sat May 16, 2015 2:53 pm
Been thanked: 1 time
Contact:

Hi, have you on settings the URL base with the https:// ?
franckfriends
Jr. Bludit
Posts: 6
Joined: Tue Mar 14, 2017 12:22 pm

Edi wrote:Can you please post your .htaccess.
Hi Edi,

My htaccess is the one generated by Bludit by default.

Code: Select all

AddDefaultCharset UTF-8

<IfModule mod_rewrite.c>

# Enable rewrite rules
RewriteEngine on

# Deny direct access to .txt files
RewriteRule ^bl-content/(.*)\.txt$ - [R=404,L]

# All URL process by index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*) index.php [PT,L]

_________ <- here i've inserted many rules found on the Internet but with no success

</IfModule>
I've tried the rules found here :
https://help.directadmin.com/item.php?id=624
and here :
http://stackoverflow.com/questions/4398 ... od-rewrite

Whatever I try it fails :(
franckfriends
Jr. Bludit
Posts: 6
Joined: Tue Mar 14, 2017 12:22 pm

diego wrote:Hi, have you on settings the URL base with the https:// ?
Yep, that's the first thing I did (in the administration interface) but with no success :(
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

franckfriends wrote: Whatever I try it fails :(
I will play around with it. In my hosting I can force to https as option when installing a certificate. ;-)
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
franckfriends
Jr. Bludit
Posts: 6
Joined: Tue Mar 14, 2017 12:22 pm

Edi wrote: I will play around with it. In my hosting I can force to https as option when installing a certificate. ;-)
Hi Edi,
From the info I've gathered so far, our host doesn't allow such an option (something to do with load balancer etc.).
Basically, we don't have such a flexibility.

So, what you mean is that there is no solution available via the .htaccess file edition, right?

Thanks again!
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

Try to add the following to .htaccess:

Code: Select all

RewriteCond %{HTTP_HOST} ^mydomain\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.mydomain\.com$
RewriteCond %{HTTPS} =off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [QSA,L,R=301]
The .htaccess then will be:

Code: Select all

AddDefaultCharset UTF-8

<IfModule mod_rewrite.c>

# Enable rewrite rules
RewriteEngine on

RewriteCond %{HTTP_HOST} ^mydomain\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.mydomain\.com$
RewriteCond %{HTTPS} =off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [QSA,L,R=301]

# Deny direct access to .txt files
RewriteRule ^bl-content/(.*)\.txt$ - [R=404,L]

# All URL process by index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*) index.php [PT,L]

</IfModule>
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
franckfriends
Jr. Bludit
Posts: 6
Joined: Tue Mar 14, 2017 12:22 pm

Hi Edi

Thanks a lot for your help.

After some more testing it appears that the problem we are encountering has nothing to do with Bludit and the way it works.

Sorry for having wasted your time. :|
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

No problem...

Does it work now?
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
Post Reply