Access site by IP address on Apache/Cpanel/WHM server

Posted on 2007-10-12
Last Modified: 2008-01-09

I have the following configuration in my httpd.conf file:


DocumentRoot /home/mydomain/public_html

For some reason when I am trying to access the site using the IP address I don't see the contents of /home/mydomain/public_html directory (I have a specific index.html there) but I see the server's default page.

Basically I am looking to transfer a site on that server and during the DNS change I want the users to be able to access the site using the new IP on their browsers (the old site will re-direct to the new IP).

Any ideas?
Question by:infodigger
    LVL 28

    Accepted Solution

    You can either provide a unique IP for the new site or another hostname.

    The hostname method is usually what I do.  Add to your DNS and in Apache:  

    Then just redirect to the new domain.

    When you change the address record for www to the new IP, Apache will respond accordingly.

    Author Comment

    Lol:) How did I not think about that? !!

    Thanks so much for the tip!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
    It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
    This video discusses moving either the default database or any database to a new volume.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now