Softaculous


Topic : Using redirects to have https by default?


Posted By: nexperia on September 8, 2017, 4:28 pm
I apologize in advance since I am not a tech person:

I have a domain with a provider and I redirect it via dns on an external  VPS running Webuzo.
- Redirect to webuzo works fine.
- I have also installed ssl certificate using Let's Encrypt and works ok.
- I therefore can reach https://mydomain as well as http://mydomain

However what I would like to do is to force https by default so that end users do not need to type https, how can I achieve this?

I have tried with the Redirects option int the Webuzo end user domain section:
it does redirect, but I keep getting the "too many redirects error message".

Please help me, I have spent a whole day trying to achieve that.

Thank you!

Antonio

Posted By: nikhil89 on September 9, 2017, 5:07 am | Post: 1
Hi Antonio,

You can force your domain to https by default using the .htaccess file if you are using Apache as your default web server. You can refer to the below guide for the code on how to redirect using .htaccess:
http://www.inmotionhosting.com/support/website/ssl/how-to-force-https-using-the-htaccess-file

Hope this helps you. Please let us know if you need any further information. We will be happy to help you.

Posted By: nexperia on September 9, 2017, 10:52 am | Post: 2
Thanks for your response, could not try your solution, although I am sure it works, since I found another similar way to achieve that by adding the following code in th htaccess inside the drupal installation:

# Redirect to HTTPS
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

That seems to work for me

Regards

Posted By: webuzo_manager on September 12, 2017, 5:34 am | Post: 3
Hi nexperia,

Thanks for posting the solution :)

Powered By AEF 1.0.8 © 2007-2008 Electron Inc.