1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How can i do https://xx.com redirect to https://www.xx.com

Discussion in 'Apache' started by iKiller, May 21, 2009.

  1. #1
    i wasted a lot of time looking for an answer to that question but no luck

    i was able to redirect from

    http://xx.com to https://www.xx.com
    and
    http://xx.com to http://www.xx.com

    but this case isn't working at all :

    https://xx.com to https://www.xx.com

    i could do it via php but i need to do it using htaccess since i don't want to accept the certificate before redirection , i want to redirect first to go to the verified www-domain certificate .

    i hope some one has a genius idea to do it .
     
    iKiller, May 21, 2009 IP
  2. szalinski

    szalinski Peon

    Messages:
    341
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    could you at least post here the code you have been trying, so we can see if there's any way to fix it. thanks.
     
    szalinski, May 26, 2009 IP
  3. jnugroho73

    jnugroho73 Peon

    Messages:
    77
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Try the following code for your htaccess:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} ^xx.com$
    RewriteRule ^.* https://www.xx.com$1 [R=301,L]
    </IfModule>
    Code (markup):
    Good luck
     
    jnugroho73, May 27, 2009 IP
  4. Vekseid

    Vekseid Peon

    Messages:
    124
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I prefer

    
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} !^www.xx.com$
    RewriteRule ^.* https://www.xx.com$1 [R=301,L]
    </IfModule>
    
    Code (markup):
     
    Vekseid, May 28, 2009 IP
  5. jnugroho73

    jnugroho73 Peon

    Messages:
    77
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    If so, then when somebody enter in address like
    http://www.xx.com

    You will get no redirect action
     
    jnugroho73, Jun 3, 2009 IP
  6. Vekseid

    Vekseid Peon

    Messages:
    124
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Exactly, the OP wants to redirect to www. This also redirects things like ww.xx.com and wwww.xx.com, etc.
     
    Vekseid, Jun 3, 2009 IP
  7. iKiller

    iKiller Guest

    Messages:
    52
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    i already solved this guys using php .

    the problem about the above posted code is when some body access the site using :

    https://xx.com

    no redirect will happen , so i solved it using a global included few lines.
     
    iKiller, Jun 13, 2009 IP