wildcard to rewritre multi domains to www

Gena Makhomed gmm at csdoc.com
Sun Sep 6 15:09:48 MSD 2009


On Sunday, September 6, 2009 at 7:29:09, Igor Sysoev wrote:

IS> server {
IS>      server_name  ~^([^.]\.com)$;
IS>      set          $name  $1;
IS>      rewrite      ^      http://www.$name$request_uri?  permanent;
IS> }

    server {
        server_name ~^(?!www\.);
        rewrite  ^  http://www.$host$request_uri? permanent;
    }

    (c) Igor Sysoev, 15 Sep 2008, http://www.lexa.ru/nginx-ru/msg19431.html

-- 
Best regards,
 Gena






More information about the nginx mailing list