On 23.03.2011, at 15:40, sevy wrote:
> I've read the whole NginX wiki and couldn't find a solution yet. So
> would you be so gentle to tell me how to do this.
>
> I have two (2) domains on the same website. Let's say "www.first.com"
> and "www.second.com"
> The frontend php shares the same files and the only difference is in
> the
> layout so I must differentiate the layout based on the hostname header
> sent by client.
>
> My goal would be to redirect to the www domain if an invalid subdomain
> is typed.
>
> example: error.first.com must redirect to www.first.com as well as
> wrong.second.com must redirect to www.second.com
>
> My setup when I was using a single domain was easy:
>
>
> if ($host !~* "www.first.com") {
> rewrite ^(.*)$ http://www.first.com$1 permanent;
> break;
> }
>
>
> but now my need is to do something like:
>
>
> if ($host !~* "www.first.com|www.second.com") {
> rewrite ^(.*)$ (what to put here???)$1 permanent;
> break;
> }
>
>
> Thanks to anyone able to help me out with this issue...
http://nginx.org/en/docs/http/converting_rewrite_rules.html
--
Igor Sysoev
http://sysoev.ru/en/
_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx