Q:

Use rewrite rule by query string

How can I make that if the QUERY_STRING matches something it would use that rule? 
Options +FollowSymlinks -MultiViews
RewriteEngine On
RewriteBase /

RewriteRule ^(.*)/?$ index.php?uri=$1 [L,QSA]

RewriteCond %{QUERY_STRING} uri=admin
ReqriteRule ^admin\?(.*)/?$ index.php?uri=admin&q=$1 [L,QSA]

Eg.  http://localhost/admin?poll/new
After the ?  should be the paramater q, the the query would be uri=admin&q=poll/new
Any idea on how I could do this? 
Thanks. 

A:

Well, it happens that your problem is more simple than the link I gave you as you do not want any analysis on the query string content. 
If you use this single line:
RewriteRule ^admin index.php?uri=admin&q= [L,QSA]

Where QSA mean append the query string to the result.  You will obtain an internal redirection to:
index.php?uri=admin&q=&poll/new

Which is not OK, this is because the way you use argument (admin?poll/new) is not the standard way.  So it seems we'll need to capture the query string content and put it by hand on the rewriteRule.  This should work (if you need it only for /admin url):
RewriteCond %{REQUEST_FILENAME} admin [NC]
RewriteCond %{QUERY_STRING} (.*) [ NC]
RewriteRule .*  index.php?uri=admin&q=%1 [L]

Where %1 is the first parenthesis match in the RewriteCond :(.*),  meaning everything in the query string, the query string being anything after the question mark.  So in fact this allows admin?poll/new but also admin?poll/new&foo=toto, giving  index.php?uri=admin&q=poll/new&foo=bar

