3 directions to HTTPS

Discussion in 'Apache' started by Evely, Nov 10, 2009.

  1. #1
    Hi

    I need redirect 3 posible directions to https in htaccess,
    example:

    www.domain.com
    http://www.domain.com
    domain.com

    to

    https://www.domain.com

    In ever tip I do have problems with cookies and redirections, please help, I don´t know how finish this problem.
     
    Evely, Nov 10, 2009 IP
  2. organicCyborg

    organicCyborg Peon

    Messages:
    330
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #2
    organicCyborg, Nov 10, 2009 IP
  3. Evely

    Evely Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks, but this code don´t work:

    when I go to domain.com he goes to https://domain.com and it´s necesary go to https://www.domain.com

    the domain have 5 subdomains, when I go to one subdomain he goes to https://subdomain.domain.com and don´t work, because subdomain don´t have SSL

    I need write 3 rules, no 1 for all, but thanks for you help :)
     
    Evely, Nov 16, 2009 IP
  4. Evely

    Evely Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    any idea :eek:
     
    Evely, Nov 18, 2009 IP
  5. vpslime

    vpslime Peon

    Messages:
    38
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Hey!
    Just add the static domain in the RewriteRule:
    
    RewriteRule (.*) https://www.domain.com/%{REQUEST_URI}
    Code (markup):
     
    vpslime, Nov 22, 2009 IP
  6. harishsyndrome

    harishsyndrome Peon

    Messages:
    128
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Use redirection url in meta content.

    <head>
    <meta content URL = "<url">
    </head>
     
    harishsyndrome, Dec 2, 2009 IP