Mobile app version of vmapp.org
Login or Join
Lengel546

: How can set a local host ip address to forward to local host virtual host domain name I want to forward different domain names to single IP Address (local for testing), but how can i recognize

@Lengel546

Posted in: #Localhost #Php #Server #Virtualhost #Webserver

I want to forward different domain names to single IP Address (local for testing), but how can i recognize in pc that which domain name should be linked to which folder?

For example in my windows host file I have added the following entries:

127.0.0.1 abc.com
127.0.0.1 test.abc.com
127.0.0.1 test1.abc.com

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Lengel546

1 Comments

Sorted by latest first Latest Oldest Best

 

@Gloria169

When request is sent from browser to website, the "Host" header is sent which will contain the host name (e.g. Host: test.example.com).
Web server (Apache, IIS, nginx etc) will check that request header and will route to correct virtual site / folder accordingly to the rules that you have defined in your web server configuration (when creating website in web server, you providing to what host names it should respond to).

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme