atom feed69 messages in ru.sysoev.nginxRe: wildcard to rewritre multi domain...
FromSent OnAttachments
Igor SysoevAug 28, 2009 6:40 am 
Igor SysoevAug 28, 2009 8:28 am 
Michael ShadleAug 28, 2009 9:10 am 
Igor SysoevAug 28, 2009 9:24 am 
Michael ShadleAug 28, 2009 9:38 am 
Igor SysoevAug 28, 2009 9:54 am 
Igor SysoevAug 28, 2009 9:56 am.Other
SteveAug 28, 2009 1:23 pm 
SteveAug 28, 2009 2:33 pm 
191919Aug 28, 2009 6:32 pm 
AMP AdminAug 28, 2009 9:36 pm 
Ilan BerknerAug 28, 2009 9:42 pm 
Gabriel RamugliaAug 28, 2009 10:14 pm 
Igor SysoevAug 29, 2009 2:49 am 
Jeff WaughAug 29, 2009 5:35 am 
AMP AdminAug 29, 2009 8:26 am 
Gabriel RamugliaAug 29, 2009 2:09 pm 
AMP AdminAug 29, 2009 4:51 pm 
Gabriel RamugliaAug 29, 2009 6:10 pm 
AMP AdminAug 29, 2009 7:12 pm 
AMP AdminAug 29, 2009 7:58 pm 
Gabriel RamugliaAug 29, 2009 9:10 pm 
Marcus ClyneAug 29, 2009 10:57 pm 
Martin SchutAug 30, 2009 5:38 am 
AMP AdminAug 30, 2009 7:21 am 
AMP AdminAug 30, 2009 7:25 am 
Marcus ClyneAug 30, 2009 7:52 am 
AMP AdminAug 30, 2009 8:38 am 
Jim OhlsteinAug 30, 2009 8:57 am 
AMP AdminAug 30, 2009 9:38 am 
Gabriel RamugliaAug 30, 2009 12:37 pm 
AMP AdminAug 30, 2009 1:37 pm 
AMP AdminAug 30, 2009 7:31 pm 
AMP AdminAug 30, 2009 7:43 pm 
Jim OhlsteinAug 30, 2009 8:02 pm 
Gabriel RamugliaAug 30, 2009 9:30 pm 
Igor SysoevAug 30, 2009 10:44 pm 
AMP AdminAug 31, 2009 12:07 pm 
Gabriel RamugliaAug 31, 2009 12:27 pm 
AMP AdminAug 31, 2009 1:58 pm 
AMP AdminAug 31, 2009 2:02 pm 
Igor SysoevAug 31, 2009 2:02 pm 
Michael ShadleAug 31, 2009 2:07 pm 
Cliff WellsAug 31, 2009 2:20 pm 
Igor SysoevAug 31, 2009 9:40 pm 
Cliff WellsSep 1, 2009 9:30 am 
AMP AdminSep 3, 2009 6:27 am 
Igor SysoevSep 3, 2009 6:38 am 
ji...@ohlste.inSep 3, 2009 7:03 am 
AMP AdminSep 3, 2009 7:06 am 
Igor SysoevSep 3, 2009 7:10 am 
AMP AdminSep 5, 2009 6:57 am 
Igor SysoevSep 5, 2009 7:20 am 
AMP AdminSep 5, 2009 9:27 am 
Cliff WellsSep 5, 2009 1:12 pm 
Marcus ClyneSep 5, 2009 1:52 pm 
AMP AdminSep 5, 2009 2:06 pm 
brianmercerSep 5, 2009 9:00 pm 
Igor SysoevSep 5, 2009 9:28 pm 
Gena MakhomedSep 6, 2009 4:09 am 
Igor SysoevSep 6, 2009 4:48 am 
AMP AdminSep 6, 2009 7:58 am 
Cliff WellsSep 6, 2009 11:05 am 
Marcus ClyneSep 6, 2009 12:23 pm 
Cliff WellsSep 6, 2009 4:41 pm 
Marcus ClyneSep 7, 2009 3:44 am 
Cliff WellsSep 7, 2009 11:06 am 
AMP AdminNov 6, 2009 11:04 am 
AMP AdminNov 6, 2009 11:50 am 
Subject:Re: wildcard to rewritre multi domains to www
From:Marcus Clyne (macc@gmail.com)
Date:Sep 5, 2009 1:52:39 pm
List:ru.sysoev.nginx

Hi,

Cliff Wells wrote:

Try this:

server { server_name ~(^.+\..+$); set $name $1; rewrite ^ http://www.$name$request_uri? permanent; }

That will cause problems if the domain begins with www. If you want to capture both www.domain.tld and domain.tld and rewrite to include the www., you could use

server { server_name ~^(www\.)?(.+)$; set $name $2; rewrite ^ http://www.$name$request_uri? permanent; }

Marcus.

On Sat, 2009-09-05 at 11:28 -0500, AMP Admin wrote:

Thanks. I'll do that. I was just hoping that I wouldn't have to list all domains. That works though. :)

Regards,

-Team AMP http://www.ampprod.com

-----Original Message----- From: owne@sysoev.ru [mailto:owne@sysoev.ru] On Behalf Of Igor Sysoev Sent: Saturday, September 05, 2009 9:21 AM To: ngi@sysoev.ru Subject: Re: wildcard to rewritre multi domains to www

On Sat, Sep 05, 2009 at 08:57:57AM -0500, AMP Admin wrote:

Hi, I would like to rewrite several domains to from .example.com to www.example.com. I think the best way is to use a wild card. Too bad I suck at rewrite rules. Haha

Can someone help me make the following work?

if ($host != 'www.*.com') { rewrite ^/(.*)$ http://www.*.com/$1 permanent; }

server { server_name ~^((?:domain1|domain2|domain3)\.com)$; set $name $1; rewrite ^ http://www.$name$request_uri? permanent; }