我注册了www.❺➠.ws,与www.naildrivin5.com的知识产权相同。
curl www.❺➠.ws
返回www.naildrivin5.com的主页。 没问题。 我修改Apache以使用基于名称的虚拟主机,如下所示:
<VirtualHost the.ip.address.here:80> ServerName xn--dfi5d.ws DocumentRoot /home/foo/xn--dfi5d.ws/html
(xn--dfi5d.ws是punycode的版本,我的理解是你是如何为IDN设置apache的)
Firefox和Safari都能成功find我configuration的新主页。
但是,curl不正常。 curl www.❺➠.ws 仍返回www.naildrivin5.com主页,而curl xn--dfi5d.ws返回www.❺➠.ws主页。
我尝试使用-H "Host: www.❺➠.ws"来查看是否需要明确设置该头部,但似乎没有。
我在OS X上运行curl,并将这些字符粘贴到Terminal.app中。
我主要关心的是,我已经正确地设置了Apache,以正确地将请求发送到www.❺➠.ws到合适的地方(即不要 www.naildrivin5.com)。
任何curl专家都有关于如何诊断的build议?
当我访问www.❺➠.ws或www.xn--dfi5d.ws时,我会得到naildrivin5.com网站。 如果我离开www,我会得到❺➠.ws网站。
您需要为www添加案例:
<VirtualHost the.ip.address.here:80> ServerName xn--dfi5d.ws ServerAlias www.xn--dfi5d.ws DocumentRoot /home/foo/xn--dfi5d.ws/html </VirtualHost>