HTTP to HTTPS redirects for Drupal Multisite Setup
Hi,
I have a Drupal 7 multisite installation in a cPanel account, currently serving 3 domains. I have SSL certificates installed and working. However I need to ensure that all HTTP traffic is redirected to HTTPS for all domains.
Since Drupal use a single .htaccess file, I'm struggling with how to configure it correctly.
So, this is what I want to accomplish:
Any suggestions?
http://domain1.com to be redirected to https://domain1.com
http://www.domain1.com to be redirected to https://www.domain1.com
http://domain2.com to be redirected to https://domain2.com
http://www.domain2.com to be redirected to https://www.domain2.com
http://domain3.com to be redirected to https://domain3.com
http://www.domain3.com to be redirected to https://www.domain3.com
Any suggestions?
-
Have you tried using a Drupal module to do this? I use Secure Pages and it does the job - but I'm not in a multisite setup. 0 -
You could try... RewriteEngine on RewriteCond %{HTTPS} !=on RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
orRewriteEngine on RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]0 -
Hello, You may also find these threads helpful: force https for a given website and not all hosted accounts SOLVED - HTTPS Redirection For All VirtualHosts Thank you. 0 -
Have you tried using a Drupal module to do this? I use Secure Pages and it does the job - but I'm not in a multisite setup.
It might be a solution, however the Secure pages module is not something I would use in a production environment. The latest version is a beta 2 from November 2013. The issue queue, well... Also this module is not covered by Drupal"s security advisory policy.0
Please sign in to leave a comment.
Comments
4 comments