I've registered www.❺➠.ws, which goes to the same IP as www.naildrivin5.com.
curl www.❺➠.ws
returns the homepage of www.naildrivin5.com. No problem. I modify apache to use name-based virtual hosts as follows:
<VirtualHost the.ip.address.here:80>
ServerName xn--dfi5d.ws
DocumentRoot /home/foo/xn--dfi5d.ws/html
(the xn--dfi5d.ws is the punycode version, and my understand is that is how you set up apache for IDNs)
Both Firefox and Safari successfully find the new homepage I have configured.
However, curl is not working quite right. curl www.❺➠.ws
still returns the www.naildrivin5.com homepage, while curl xn--dfi5d.ws
returns the www.❺➠.ws hompage.
I tried using -H "Host: www.❺➠.ws"
to see if setting that header explicitly was required, but it seems not.
I'm running curl on OS X and pasting those characters into the Terminal.app.
My main concern is that I've properly set up Apache to correctly route requests to www.❺➠.ws to the right place (i.e. not to www.naildrivin5.com).
Any curl experts have some suggestions on how to diagnose this?
-
I get the naildrivin5.com site when I go to www.❺➠.ws or www.xn--dfi5d.ws in Chrome. If I leave off the www, I get the ❺➠.ws site.
You need to add the case for www:
<VirtualHost the.ip.address.here:80> ServerName xn--dfi5d.ws ServerAlias www.xn--dfi5d.ws DocumentRoot /home/foo/xn--dfi5d.ws/html </VirtualHost>
Unkwntech : I'm seeing the same results here.davetron5000 : I made that change (which makes sense, and I should've), however curl still finds www.naildrivin5.com, when I do `curl ❺➠.ws` it doesn't work, still. If I set the "HOST" header to www.❺➠.ws, no dice, but setting the HOST header to the punyname works. Is this expected? I guess headers probably can't/shouldn't contain unicode?Dennis Williamson : I just went to www.❺➠.ws in Chrome and got the naildrivin5 site. When I cleared the cache (Ctrl-F5), it loaded the www.❺➠.ws site. I have been unable to locate information on clearing curl's cache. Also, curl retrieves the www.❺➠.ws page for me as expected with or without the www. Unfortunately, I didn't test that before you added the ServerAlias. You might try setting CacheDisable temporarily in your VirtualHost configuration to see if that helps. http://httpd.apache.org/docs/2.2/mod/mod_cache.htmldavetron5000 : Well, that didn't do anything. I think I'm gonna mark this as correct, since, if I set the Host header in curl to the punycodename, all is good.From Dennis Williamson
0 comments:
Post a Comment