Steps to redirect IP address to domain name

kumkumsharma

Administrator
Staff member
If you want to redirect your IP address to domain name then it is must to have administrative access or you can contact your hosting provider regarding this.

You can follow below steps:
  • Login to Plesk.
  • Click on Tools & Settings >> IP addresses >> Click on particular IP address like 203.13.113.4.
  • Here specify the default domain name at Default Site option from dropdown.
  • Now add the below directive at this path Domains >> example.com >> Apache & nginx settings >> Additional nginx directives and click Apply.
Code:
if ($host ~ '203.0.113.2'){
rewrite ^/(.*)$ https://example.com/$1 permanent;
}
 
Top