Activities

November 2014
M T W T F S S
« Oct   Dec »
 12
3456789
10111213141516
17181920212223
24252627282930

NGINX : www redirection

Here are the simple Nginx rewrite rule to redirect all non www traffic to www domain.

# enforce www (exclude certain subdomains)
#if ($host !~* ^(www|subdomain))
#{
#   rewrite ^/(.*)$ $scheme://www.$host/$1 permanent;
#}

I took it from here http://www.farinspace.com/codeigniter-nginx-rewrite-rules/ as I see it’s the first blog I see the most of theNginx re-write rules.

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>