htaccess ssl rewrite non www to www

Discussion in 'Apache' started by cloudnthunder, Mar 29, 2010.

  1. #1
    cloudnthunder, Mar 29, 2010 IP
  2. snakeo

    snakeo Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You need to get a cert that supports both www and non-www
     
    Last edited: Sep 29, 2011
    snakeo, Sep 29, 2011 IP
  3. chtdatweb

    chtdatweb Well-Known Member

    Messages:
    1,473
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    160
    #3
    Dont know what your on about?

    Try this: - in .htaccess

    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} ^yourdomain.com [NC]
    RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [L,R=301]
     
    chtdatweb, Oct 6, 2011 IP