title: .htaccess - pretty url lost after redirecting non-www to www urls
body: <p>I have made .htaccess 301 redirect to reirect non www to www, which is working fine but my pretty url is lost when a page is accessed with non www url.</p>
  
  <p>I have done it this way.</p>
  
  <pre><code>Options +FollowSymlinks
  RewriteEngine on
  Rewritecond %{HTTP_HOST} ^site.com [NC]
  Rewriterule ^(.*)$ http://www.site.com/$1 [R=301,NC]
  RewriteRule ^([^/]*)/(.*\.html) process/?category=$1&amp;link=$2 [L]
  </code></pre>
  
  <p>It redirects url </p>
  
  <pre><code>http://www.site.com/software/page.html 
  </code></pre>
  
  <p>To </p>
  
  <pre><code>http://www.site.com/process/index.php?category=software&amp;link=page.html
  </code></pre>
  
  <p>Properly without loosing pretty url <code>www.site.com/software/page.html</code> in address bar. </p>
  
  <p>It redirects url </p>
  
  <pre><code>http://site.com/software/page.html 
  </code></pre>
  
  <p>To </p>
  
  <pre><code>http://www.site.com/process/index.php?category=software&amp;link=page.html
  </code></pre>
  
  <p>Properly and now pretty url is lost and address in address bar is</p>
  
  <pre><code>http://www.site.com/process/index.php?category=software&amp;link=page.html
  </code></pre>
  
  <p>Instead of</p>
  
  <pre><code>http://site.com/software/page.html
  </code></pre>
  
  <p>How to keep pretty url when page is accessed without www.</p>
  
  <p>Please see and suggest any way to do this.</p>
  
  <p>Thanks</p>