I assume you want to replace the previous "tag rule" inside your .htaccess file? Because it conflicts with what you ask in this question. I'd say all you need to do is this:
RewriteEngine On
RewriteRule ^tag/(.*)$ $1 [QSA,L]
RewriteRule ^([^/]+)/$ a-search.php?q=$1 [L]
If instead you want to add a specific rule, so an exception, then this probably is what you are looking for:
RewriteEngine On
RewriteRule ^tag/iphone/(.*)$ iphone/$1 [QSA,L]
RewriteRule ^tag/.* /tag.php [QSA,L]
RewriteRule ^([^/]+)/$ a-search.php?q=$1 [L]
A general remark: .htaccess
style files are notoriously error prone, they make things complex, are hard to debug and really do slow down the server. They they should only be used in two situations:
- if you do not have access to the real host configuration (otherwise palce the rules in there!)
- if you require dynamic changes to the rule set by some web application (though think twice about the security implications)
In all other cases it makes much more sense to use the real host configuration instead of .htaccess
style files.