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!

How do I redirect secure connections to subdomain and show same content?

Discussion in 'Security' started by stefanbc, Apr 22, 2015.

  1. stefanbc

    stefanbc Well-Known Member

    Joined:
    Apr 13, 2015
    Messages:
    52
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    toronto
    cPanel Access Level:
    Root Administrator
    HI,

    I have only one secure certificate on secure.adomain.com and I would like to make sure that the content from adomain.com/secure-form redirects to https://secure.adomain.com/secure-form.

    I have the web redirect figured out but I don't know what I have to do to make sure the same content from adomain.com is shown at secure.adomain.com and if possible force all secure.adomain.com to use SSL.

    What files do I have to edit to achieve the above, maybe start with making sure the content is visible for the subdomain as well then make sure only secure connections are allowed.

    Thank you
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,230
    Likes Received:
    1,938
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    You could try an entry in the .htaccess file like this:

    Code:
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^domain\.com [NC]
    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^(.*)$ https://domain.com/$1 [R,L]
    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
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