title: opencart rewrite .htaccess
body: <p>Website use the opencart cms, SEO url enabled, so the .htaccess looks :</p>
  
  <pre><code> RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
  RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
  RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
  </code></pre>
  
  <p>all works perfect, but i wanted to add the 301 redirect from non www to www, so i added:</p>
  
  <pre><code>RewriteCond %{HTTP_HOST} ^example.com$ [NC]
  RewriteRule ^(.*) http://www.example.com/$1 [R=301,L]
  </code></pre>
  
  <p>It works, but when i try to redirect link with category or product it adds "index.php?<em>route</em>="</p>
  
  <p>Example:</p>
  
  <p>"www.example.com/cats", if i try "example.com/cats" without "www" the link will look www.example.com/index.php?<em>route</em>=cats</p>