.htaccess - How to redirect domain to ip using htaccess in php -


i using ajax code https call. when using direct ip, works ip, if use domain name not working.
if change domain name works domain name.

i want work both ip , domain. how can this?

jquery.ajax({             url : "https://banglamail.test.com:8080/test.php",             type: "post",             data : 'username='+user_name+'&password='+password, 

then it's working https://banglamail.test.com:8080/test.php, if put ip instead https://192.168.21.30:8080/test.php it's not working.

can please suggest me how can put rule in .htaccess file?