Rewrite foo.com. to foo.com

Wayne E. Seguin wayneeseguin at gmail.com
Thu Nov 8 07:10:55 MSK 2007


On Nov 7, 2007 6:06 PM, Ezra Zygmuntowicz <ez at engineyard.com> wrote:
> if ( $host ~* (.*?\.?foo\.com)\.)$ {
>     set $domainwithoutdot $1;
>      rewrite ^(.*)$ http://$domainwithoutdot$1 permanent;
> }

Ezra,

Why is the '$' outside the if() parenthesis? Also try $http_host.

  ~Wayne





More information about the nginx mailing list