Forum Moderators: phranque

Message Too Old, No Replies

Accessing vhosts without using the domain

         

Numberman

11:42 pm on Oct 5, 2004 (gmt 0)

10+ Year Member



Is it possible for me to access a site without going through the domain? I've got an apache server and all my sites are setup as vhosts, and I only have one IP. The reason I ask is because I'd like to test some of my sites server-side before their domains are setup.

To illustrate what I mean, I've ordered a domain example-domain.com, and setup a vhost for it. I'd like to access the contents of example-domain.com before the domain is configured. How would I go about this?

Thanks for any help,
Numberman

encyclo

12:12 am on Oct 6, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If it is only for you to test, the easiest way is to add an entry in your hosts file on your desktop machine, associating the domain name with the IP address. That way, you'll bypass any DNS searching and be sent directly to the right server and virtual host.

The location of your hosts file depends on the operating system you're running. The file name is simply "hosts" without a file extension, so just do a search on your machine.

All you need to add is an entry like this:

12.34.56.789 www.example.com

Numberman

12:25 am on Oct 6, 2004 (gmt 0)

10+ Year Member



Thanks, that worked like a charm.