Q:

htaccess redirect dynamic url to static url

I've some url rewrites something like that:
RewriteRule ^futbol-video/([^/]*)-([^-]*)\.html$ /html/video.php?text=$1&id=$2 [L]

RewriteRule ^futbol-takimi/([^/]*)-([^-]*)\.html$ /html/takim.php?text=$1&id=$2 [L]

I'm trying to redirect dynamic queries to static pages. I've tried something below but get everytime internal server error. How shoul I write the rule form 301 redirects?
First I've tried:
RewriteRule ^futbol-video/([^/]*)-([^-]*)\.html$ /html/video.php?text=$1&id=$2 [R=301,L]

RewriteRule ^futbol-takimi/([^/]*)-([^-]*)\.html$ /html/takim.php?text=$1&id=$2 [R=301,L]

But get internal server error. 

A:

I believe you are handling query strings incorrectly.
See the following blog posts for some examples that utilize RewriteCond for handling query strings.

http://www.simonecarletti.com/blog/2009/01/apache-query-string-redirects
http://www.simonecarletti.com/blog/2009/01/apache-rewriterule-and-query-string/

Example from the blog:
#Keep original query (default behavior)
RewriteRule ^page\.php$ /target.php [L]
# from http://example.com/page.php?foo=bar
# to   http://example.com/target.php?foo=bar

#Discard original query
RewriteRule ^page\.php$ /target.php? [L]
# from http://example.com/page.php?foo=bar
# to   http://example.com/target.php

#Replace original query
RewriteRule ^page\.php$ /target.php?bar=baz [L]
# from http://example.com/page.php?foo=bar
# to   http://example.com/target.php?bar=baz

#Append new query to original query
RewriteRule ^page\.php$ /target.php?bar=baz [QSA,L]
# from http://example.com/page.php?foo=bar
# to   http://example.com/target.php?foo=bar&bar=baz

EDIT
Additionally, if you are trying to redirect FROM a url with query strings to a static page, the url with the query string must come first in the rewrite rule (or be placed in a rewrite condition), not second like you have it.

