Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想将不同的域名转发到单个 IP 地址(本地用于测试),但是我如何在 pc 中识别哪个域名应该链接到哪个文件夹?
例如,在 Windows 主机文件中,我写了
127.0.0.1 abc.com 127.0.0.1 test.abc.com 127.0.0.1 test1.abc.com
在同一部分中找到将and指令VirtualHost绑定在一起。ServerNameDocumentRoot
VirtualHost
ServerName
DocumentRoot
<VirtualHost *:80> ServerName www1.example.com DocumentRoot /srv/web/www1 </VirtuaHost> <VirtualHost *:80> ServerName www2.example.com DocumentRoot /srv/web/www2 </VirtuaHost>