title: .htaccess Rewrite URL with a query string
body: <p>I have tried a ton of solutions posted at stackoverflow but nothing seems to work for me. I would like to rewrite a few URLs on my site to be search engine friendly.</p>
  
  <p>I would like a URL like this:-
  <a href="http://www.mysite.com/index.php?filter=accounts" rel="nofollow">http://www.mysite.com/index.php?filter=accounts</a>
  To display as:-
  <a href="http://www.mysite.com/accounts" rel="nofollow">http://www.mysite.com/accounts</a></p>
  
  <p>A lot of posts around the web give this as the solution:-</p>
  
  <pre><code>RewriteRule ^([^/]+)/?$ index.php?filter=$1 [QSA,L]
  </code></pre>
  
  <p>But this doesn't do anything.</p>
  
  <p>My site is a Joomla CMS site and there are already some rewrites within the .htaccess file. Could it be that I am putting my new RewriteRule is the wrong place?</p>
  
  <p>Here is the full .htaccess file without my new RewriteRule added</p>
  
  <pre><code>Options +FollowSymLinks
  RewriteEngine On
  
  # prevents people from accessing anything with phpMyAdmin
  RewriteRule phpMyAdmin - [F]
  
  # force canonical www if request is for non-www or has port number etc
  RewriteCond %{HTTP_HOST} !^(www\.mysite\.com)?$
  RewriteRule (.*) http://www.mysite.com/$1 [R=301,L]
  
  RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
  RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
  RewriteCond %{QUERY_STRING} (&lt;|%3C)([^s]*s)+cript.*(&gt;|%3E) [NC,OR]
  RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
  RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
  RewriteRule .* index.php [F]
  RewriteBase /
  RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  RewriteCond %{REQUEST_URI} !^/index\.php
  RewriteCond %{REQUEST_URI} (/[^.]*|\.(php|html?|feed|pdf|raw))$ [NC]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule .* index.php [L]
  </code></pre>
  
  <p>Any help would be much appreciated.
  :-)</p>