Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

HTTP to HTTPS redirects for Drupal Multisite Setup

Discussion in 'Security' started by ProUser, Aug 2, 2017.

Tags:
  1. ProUser

    ProUser Registered

    Joined:
    Jan 15, 2015
    Messages:
    2
    Likes Received:
    1
    Trophy Points:
    3
    cPanel Access Level:
    Root Administrator
    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:
    Code:
    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?
     
  2. Tearabite

    Tearabite Well-Known Member

    Joined:
    Nov 28, 2010
    Messages:
    76
    Likes Received:
    11
    Trophy Points:
    58
    Location:
    Southern California
    cPanel Access Level:
    Root Administrator
    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.
     
  3. fuzzylogic

    fuzzylogic Well-Known Member

    Joined:
    Nov 8, 2014
    Messages:
    93
    Likes Received:
    51
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    You could try...
    Code:
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{HTTPS} !=on
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    </IfModule>
    or
    Code:
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    </IfModule>
     
  4. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,167
    Likes Received:
    1,933
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. ProUser

    ProUser Registered

    Joined:
    Jan 15, 2015
    Messages:
    2
    Likes Received:
    1
    Trophy Points:
    3
    cPanel Access Level:
    Root Administrator
    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.
     
    Infopro likes this.
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice