Great! You understand that a RewriteRule includes the preceding RewriteCond statements (which the prior code did not for the rewrite.php redirection).
Now, all you need to learn is that the EVERYTHING (or NOTHING) atom is probably the most dangerous and is certainly the most abused regex there is. Think about it: What if the request is empty? What if it contains a cross-site hack of your database? Are you thoroughly scrubbing this USER INPUT before your database query in mobile.php and rewrite.php?
Those (.*) you have in your code had me create a standard rant (when I was the TL for SitePoint’s hosting boards) :
[rant #1][indent]The use of “lazy regex,” specifically the :kaioken: EVERYTHING :kaioken: atom, (.*), and its close relatives, is the NUMBER ONE coding error of newbies BECAUSE it is “greedy.” Unless you provide an “exit” from your redirection, you will ALWAYS end up in a loop![/indent][/rant #1]
If you need to review a tutorial on proper regular expressions for use with mod_rewrite, I had also created a tutorial for members at http://dk.co.nz/seo. If you have questions, you know where to find me.