atom feed13 messages in ru.sysoev.nginxRe: remove www from the url
FromSent OnAttachments
whiskybarFeb 17, 2011 6:43 am 
Edho P AriefFeb 17, 2011 6:46 am 
Jim OhlsteinFeb 17, 2011 6:47 am 
Luit van DrongelenFeb 17, 2011 6:49 am 
DayoFeb 17, 2011 7:03 am 
whiskybarFeb 17, 2011 7:07 am 
Jim OhlsteinFeb 17, 2011 7:08 am 
Igor SysoevFeb 17, 2011 7:14 am 
DayoFeb 17, 2011 7:33 am 
Francis DalyFeb 17, 2011 7:51 am 
whiskybarFeb 17, 2011 8:14 am 
Francis DalyFeb 17, 2011 3:41 pm 
lifeisjustaboutFeb 18, 2011 9:34 am 
Subject:Re: remove www from the url
From:whiskybar (ngin@nginx.us)
Date:Feb 17, 2011 7:07:57 am
List:ru.sysoev.nginx

Thank you all. Your solutions seem quite elegant.

Just a note, I was hoping for something I can do inside the server only declaration, just like I can do with the opposite redirection mysite.com --> www.mysite.com:

[code] server { server_name www.mysite.com mysite.com;

if ($host !~* www\..*) { rewrite ^(.*)$ http://www.$host$1 permanent; } [/code]

On the other hand, I feel your solution with the two server declaration can even be a bit faster (not to mention easy to understand). Your solution suggests I should rewrite the above code into two server declarations as well.

Thank you very much! Jiri

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,176137,176146#msg-176146