htaccess redirect to www.

Discussion in 'Search Engine Optimization' started by esiason14, Jan 11, 2006.

  1. #1
    I'm sure this has been posted a thousand times, but I couldnt find a definitive answer.

    I want to use htaccess to redirect mydomain.com to www.mydomain.com

    Is this what I should use?
    
    RewriteEngine On
    Options +FollowSymlinks
    RewriteBase /
    RewriteCond %{HTTP_HOST} ^mydomain\.com
    RewriteRule ^(.*)$ http://www.mydomain.com/$1 [R=permanent]
    Code (markup):
    any help would be appreciated
     
    esiason14, Jan 11, 2006 IP
  2. stuw

    stuw Peon

    Messages:
    702
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I use the following:

     
    stuw, Jan 11, 2006 IP
    frankm likes this.
  3. ServerUnion

    ServerUnion Peon

    Messages:
    3,611
    Likes Received:
    296
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Use the same, but lead it off with

     
    ServerUnion, Jan 11, 2006 IP