How can I test for a URLs existeance before redirecting to it?
RewriteCond allows backreferences[0] to capture groups in the RewriteRule.
RewriteCond %{HTTP_USER_AGENT} Mobile
RewriteCond $1.html -f
RewriteRule ^(.*)\.shtml$ $1.html [R]
[0] More like a forward reference actually...