Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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
share|improve this question

closed as not a real question by paulmorriss Feb 28 '13 at 17:17

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

3  
Question doesn't make sense. Give us an example of what you have tried and what does or doesn't work –  Steve Jun 15 '12 at 7:05
1  
Can you specify which webserver you're using (e.g. Apache or IIS) so that we can give more specific instructions? –  paulmorriss Jun 15 '12 at 11:46
add comment

1 Answer 1

  1. 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).

  2. 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).

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.