<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.apple-style-span
        {mso-style-name:apple-style-span;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=IN link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>The results is same as before, it’s redirected to www<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>

<p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:
"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;
font-family:"Tahoma","sans-serif"'> Ray [mailto:gunblad3@gmail.com] <br>
<b>Sent:</b> 05 Mei 2010 15:33<br>
<b>To:</b> nginx@nginx.org<br>
<b>Subject:</b> Re: rewrite help<o:p></o:p></span></p>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>How about this?<o:p></o:p></p>

<div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

<div>

<p class=MsoNormal><span class=apple-style-span><span style='font-size:10.0pt;
font-family:"Arial","sans-serif"'>server {</span></span><span style='font-size:
10.0pt;font-family:"Arial","sans-serif"'><br>
<span class=apple-style-span>&nbsp; &nbsp; &nbsp; &nbsp;listen &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp;80;</span><br>
<span class=apple-style-span>&nbsp; &nbsp; &nbsp; &nbsp;server_name &nbsp;
&nbsp;&nbsp;<a href="http://yahoo.example.com/" target="_blank"><span
style='color:#C3390B'>yahoo.example.com</span></a>;</span><br>
<br>
<span class=apple-style-span>&nbsp;&nbsp; &nbsp; &nbsp; location / {</span></span><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><span class=apple-style-span><span style='font-size:10.0pt;
font-family:"Arial","sans-serif"'>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; rewrite ^(.*)$&nbsp;<a href="http://www.example.com/site/yahoo$1">http://www.example.com/site/yahoo$1</a>&nbsp;last;</span></span><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><span class=apple-style-span><span style='font-size:10.0pt;
font-family:"Arial","sans-serif"'>&nbsp;&nbsp; &nbsp; &nbsp; }</span></span><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><span class=apple-style-span><span style='font-size:10.0pt;
font-family:"Arial","sans-serif"'>}</span></span><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

<div>

<p class=MsoNormal><span class=apple-style-span><span style='font-family:"Arial","sans-serif"'>Ray.</span></span><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal style='margin-bottom:12.0pt'><o:p>&nbsp;</o:p></p>

<div>

<p class=MsoNormal>On Wed, May 5, 2010 at 4:22 PM, Glen Lumanau &lt;<a
href="mailto:glen@lumanau.web.id">glen@lumanau.web.id</a>&gt; wrote:<o:p></o:p></p>

<p class=MsoNormal>I tried<br>
<br>
server {<br>
&nbsp; &nbsp; &nbsp; &nbsp;listen &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;80;<br>
&nbsp; &nbsp; &nbsp; &nbsp;server_name &nbsp; &nbsp; <a
href="http://yahoo.example.com" target="_blank">yahoo.example.com</a>;<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp;rewrite ^.+ <a
href="http://www.example.com/site/yahoo$uri" target="_blank">http://www.example.com/site/yahoo$uri</a>
last;<br>
}<br>
<br>
However it's not rewrited. It's being redirected to <a
href="http://www.example.com/site/yahoo" target="_blank">http://www.example.com/site/yahoo</a><o:p></o:p></p>

<div>

<div>

<p class=MsoNormal><br>
<br>
-----Original Message-----<br>
From: Edho P Arief [mailto:<a href="mailto:edhoprima@gmail.com">edhoprima@gmail.com</a>]<br>
Sent: 05 Mei 2010 15:16<br>
To: <a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
Subject: Re: rewrite help<br>
<br>
On Wed, May 5, 2010 at 3:09 PM, Glen Lumanau &lt;<a
href="mailto:glen@lumanau.web.id">glen@lumanau.web.id</a>&gt; wrote:<br>
&gt; Hi folks,<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; I need a rewrite rules like this<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; I have <a href="http://www.example.com" target="_blank">www.example.com</a>,
<a href="http://google.example.com" target="_blank">google.example.com</a>, <a
href="http://yahoo.example.com" target="_blank">yahoo.example.com</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; I need to rewrite<br>
&gt;<br>
&gt; <a href="http://Google.example.com" target="_blank">Google.example.com</a>
à &nbsp;<a href="http://www.example.com/site/google" target="_blank">www.example.com/site/google</a><br>
&gt;<br>
&gt; <a href="http://Yahoo.example.com" target="_blank">Yahoo.example.com</a> à
<a href="http://www.example.com/site/yahoo" target="_blank">www.example.com/site/yahoo</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; How can I do that?<br>
&gt;<br>
<br>
separate server block with rewrite on each blocks<br>
<br>
<br>
<br>
--<br>
O&lt; ascii ribbon campaign - stop html mail - <a
href="http://www.asciiribbon.org" target="_blank">www.asciiribbon.org</a><br>
<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://nginx.org/mailman/listinfo/nginx" target="_blank">http://nginx.org/mailman/listinfo/nginx</a><br>
<br>
<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://nginx.org/mailman/listinfo/nginx" target="_blank">http://nginx.org/mailman/listinfo/nginx</a><o:p></o:p></p>

</div>

</div>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

</div>

</body>

</html>