php - Redirect IP address to domain name in .htaccess -


i'm trying redirect ip address domain name of website. .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 work.

301 (permanent) redirect:

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

302 (temporary) redirect: point entire site different temporary url.

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

redirect index.html specific subfolder:

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

need understand more go here