If the subdomain maps to a subdirectory of public_html, the simplest way is to use:
Code:
Order Deny, Allow
Deny from all
Allow from XXX.XXX.XXX.XXX
though that won't give you a redirect.
As for RewriteRule, you can't match the URL scheme, host or query string in the pattern; you can only match against the path portion of the URL. Instead, you'll need to check the server name in another RewriteCond. Also, %{REMOTE_HOST} is the remote hostname, not IP. You'll most likely want to use REMOTE_ADDR.
Code:
RewriteCond %{REMOTE_ADDR} !=XXX.XXX.XXX
RewriteCond %{SERVER_NAME} ^subdomain\.
RewriteRule . /index.html [R=302,L]