Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

How to disable open site with dedicated ip as address?

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

  1. basketmen

    basketmen Well-Known Member

    Joined:
    Sep 9, 2010
    Messages:
    122
    Likes Received:
    0
    Trophy Points:
    66
    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,888
    Likes Received:
    90
    Trophy Points:
    78
    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]
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,435
    Likes Received:
    1,961
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice