Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

As you surely know you can map host names to IP addresses with the "hosts" file. This is very useful especially when you are developing as you can change localhost for project1.

That part is clear, but unfortunately I can't figure out how to set this up to open multiple projects with the same IP. I've tried a few things without success such as:

127.0.0.1/projects/project1  project1
127.0.0.1/projects/project2  project2

I checked some related questions but I couldn't find an answer. So, can I accomplish what I'm trying to do somehow? Any suggestions?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
844 views
Welcome To Ask or Share your Answers For Others

1 Answer

The hosts file is only a mapping from names to an IP. You can specify multiple names next to an IP like this:

127.0.0.1 name1 name2 name3.domain

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...