title: RewriteCond %{SERVER_NAME} syntax
body: <p>I am trying to understand the following syntax (see usage context below):</p>
  
  <pre><code>RewriteCond %{SERVER_NAME} ^example\.com$
  </code></pre>
  
  <p>I have the above (with real domain name in place of example) in my .htaccess file.  I would like to force it to be www.example.com.  </p>
  
  <p>The website has SSL and the following SSL Coding was added by the SSL Install process at GoDaddy.  So I trying to work with both this coding, and changing to force to www with the SSL.</p>
  
  <pre><code># BEGIN GD-SSL
  &lt;IfModule mod_rewrite.c&gt;
  Options +FollowSymLinks
  RewriteEngine On
  RewriteCond %{HTTPS} !=on
  RewriteCond %{HTTP_USER_AGENT} ^(.+)$
  RewriteCond %{SERVER_NAME} ^example\.com$
  RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
  Header add Strict-Transport-Security "max-age=300"
  &lt;/IfModule&gt;
  # END GD-SSL
  </code></pre>
  
  <p>I tried to add mod rewrite rules to force www and they are not working.   I think the problem resides in the RewriteCond %{SERVER_NAME} ^example.com$
  which is not resolving to the "www".  I thought I might need to add the www. to this, however, I am not sure if this is correct.<br>
  Would this be the solution to change the ssl to force WWW in the URL? Or do I need to do something else entirely?  </p>
  
  <pre><code> RewriteCond %{SERVER_NAME} ^www\.^example\.com$
  </code></pre>
  
  <p>Any help would be greatly appreciated.  Thank you.</p>
  
  <p>Becky </p>