Best way to simulate a domain?

JD Isaacks picture JD Isaacks · May 25, 2010 · Viewed 7k times · Source

I am going to build a website on a test server that will behave differently depending on which domain is used to access it (The real website will have multiple domains pointing to it).

But how will I be able to simulate the different domains on the test server?

Answer

ZZ Coder picture ZZ Coder · May 25, 2010

Just create fake domains pointing to your localhost in /etc/hosts file.

For example,

127.0.0.1   localhost domain1.com domain2.com

On Windows, this file is,

WINDOWS\SYSTEM32\DRIVERS\ETC\HOSTS