<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'><div dir='ltr'>
Tried, and same results, redirect OK but 404 response. <div><br></div><div>Thanks!!</div><div><br><br><div>> Date: Tue, 25 Oct 2011 18:15:38 +0100<br>> From: appa@perusio.net<br>> To: nginx@nginx.org<br>> Subject: Re: rewrite don't work in a multilanguage MVC site<br>> <br>> On 25 Out 2011 17h56 WEST, olfativo@hotmail.com wrote:<br>> <br>> > [1  <multipart/alternative (7bit)>]<br>> > [1.1  <text/plain; iso-8859-1 (quoted-printable)>]<br>> ><br>> > Hi!Im trying to move from Apache to nginx (v1.1.6), but you know,<br>> > rewrite newbie here... In my site when a user types http://site.com<br>> > he's redirected to http://site.com/en/, and all the other URLs are<br>> > internally handled by an index.php. This is my actual Apache<br>> <br>> Try this:<br>> <br>> At the http level.<br>> <br>> map $http_accept_language $is_english {<br>>    default 0;<br>>    ~^en  1;<br>> }<br>> <br>> map $http_accept_language $is_spanish {<br>>    default 0;<br>>    ~^es  1;<br>> }<br>> <br>> location / {<br>> <br>>   expires 30d;<br>> <br>>   if ($is_english) {<br>>      return 301 /en;  <br>>   }<br>> <br>>   if ($is_spanish) {<br>>      return 301 /es;<br>>   }<br>> <br>>   location /es {}<br>>       <br>>   location /en {}<br>> <br>>   try_files $uri $uri/ /index.php?ctr=$uri;<br>> }<br>> <br>> location ~\.php$ {<br>>   # PHP stuff<br>> }<br>> <br>> --- appa<br>> <br>> _______________________________________________<br>> nginx mailing list<br>> nginx@nginx.org<br>> http://mailman.nginx.org/mailman/listinfo/nginx<br></div></div>                                          </div></body>
</html>