from Hacker News

Ask HN: Apache RewriteCond with QueryString

by marvwhere on 2/13/13, 10:26 AM with 0 comments

hey there,

i have a little issue with an Apache Redirect.

old url: domain.com/q.php?q=test&enter=enter

what i want: domain.com/suche/test

what i currently use: RewriteCond %{QUERY_STRING} ^q=(.)enter$ [NC] RewriteRule ^q\.php$ /suche/%1? [NC,L,R=301]

which results in: domain.com/suche/test&enter

why is "^q=(.)&$" not working as a condition?