http to https

Discussion in 'Apache' started by kolucoms6, Jan 31, 2011.

  1. #1
    I have written .htaccess:

    RewriteEngine On

    RewriteCond %{SERVER_PORT} 443
    RewriteCond %{HTTP_HOST} !^www\.fullpcrepair\.com$ [NC]
    RewriteRule ^(.*)$ https://www.fullpcrepair.com/$1 [L,R=301]

    But I can still open www.fullpcrepair.com and also http://www.fullpcrepair.com

    How to restrict that ?
     
    kolucoms6, Jan 31, 2011 IP
  2. srisen2

    srisen2 Peon

    Messages:
    359
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    try this

    RewriteEngine On
    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^(.*)$ https://www.fullpcrepair.com/$1 [R,L]
     
    srisen2, Feb 1, 2011 IP
  3. blackbrontok

    blackbrontok Peon

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    for the first u must install SSL on ur hosting
     
    blackbrontok, Feb 6, 2011 IP