The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to disable open site with dedicated ip as address?

Discussion in 'Bind / DNS / Nameserver Issues' started by basketmen, Oct 30, 2015.

  1. basketmen

    basketmen Well-Known Member

    Joined:
    Sep 9, 2010
    Messages:
    118
    Likes Received:
    0
    Trophy Points:
    16
    Some my site using dedicated ip, for example 1.2.3.4

    currently i can open the site by typing dedicated ip http://1.2.3.4 as address
    how to disable this & make http://1.2.3.4 redirect to clientdomain.com ?
     
  2. 24x7server

    24x7server Well-Known Member

    Joined:
    Apr 17, 2013
    Messages:
    1,146
    Likes Received:
    34
    Trophy Points:
    48
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hello :),

    Try to update following code in your domain .htaccess file to redirect your IP to domain URL.

    Code:
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} ^1\.2\.3\.4$
    RewriteRule ^(.*)$ http://www.clientdomain.com/$1 [L,R=301]
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Yes, the previous post is accurate if you want a redirect to your domain name instead of adding a new VirtualHost for the IP address and seeing the default cPanel pages.

    Thank you.
     
Loading...

Share This Page