I am not great at writing regex's for .htaccess redirection but I managed to write this for redirecting basedon useragent.. My useragent String will contain a custom string at the end.. Let's just call this ABC.
RewriteCond %{HTTP_USER_AGENT} ^.*ABC$
RewriteRule ^(.*)index\.php$ /$1?&mode=test&app=true [R=301,L]
However, though I am pretty sure that the user-agent request header contains the string. I cannot manage to get it redirected even to a different domain. Pretty sure both the lines are wrong.. the first by maybe 10% and the second by a 50%.
Can someone help me understand how to fix this?
Additional Data "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0 ABC"