在.htaccess中将IP地址重定向到域名

I'm trying to redirect the IP address to the domain name of my website. This is my .htaccess file:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On

RewriteBase /

RewriteCond %{HTTP_HOST} ^198\.50\.227\.185 [nc]
RewriteRule ^(.*)$ http://www.allrealfood.com/$1 [r=301,nc,L]

RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

I can't figure out how to get this to work.

301 (Permanent) Redirect:

Redirect 301 / http://mt-example.com/   

302 (Temporary) Redirect: Point an entire site to a different temporary URL.

Redirect 302 / http://mt-example.com/

Redirect index.html to a specific subfolder:

Redirect /index.html http://example.com/newdirectory/

Need to understand more go here