Rewrite foo.com. to foo.com

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


On Nov 7, 2007 11:10 PM, Wayne E. Seguin <wayneeseguin at gmail.com> wrote:
> 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.

What I meant to say (wasn't supposed to be a question) is try moving
the $ just after the \.

  ~Wayne





More information about the nginx mailing list