Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best way to simulate a domain?

Tags:

php

apache

lamp

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?

like image 396
JD Isaacks Avatar asked May 25 '10 12:05

JD Isaacks


1 Answers

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
like image 114
ZZ Coder Avatar answered Sep 20 '22 06:09

ZZ Coder