Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

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>
share|improve this answer
    
I'm seeing the same results here. –  Unkwntech Sep 21 '09 at 2:25
    
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? –  davetron5000 Sep 21 '09 at 14:19
    
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. httpd.apache.org/docs/2.2/mod/mod_cache.html –  Dennis Williamson Sep 21 '09 at 16:32
    
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. –  davetron5000 Sep 21 '09 at 19:35
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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