I think the first problem is that you&#39;re redirecting to wiki.php instead of to the &quot;/WIKIPAGE&quot; url. As I found out last week, replacing query strings in nginx can be tricky. Does this work? (it won&#39;t work with more query string params)<br>
<br>server {<br>&nbsp; if ($query_string ~ ^wiki=(.*)$) {<br>&nbsp;&nbsp;&nbsp; rewrite ^(.*)$ /$1 break;<br>&nbsp; }<br>}<br><br>-tieg<br><br><div class="gmail_quote">On Sun, Mar 9, 2008 at 3:01 PM, Per Hans Hansen &lt;<a href="mailto:pehaha@gmail.com">pehaha@gmail.com</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I try to create a very simple rewrite rule with nginx, but i doesnt work.<br><br>I have set up my server with a &quot;catch all&quot; server_name *.mydomain.com<br>
<br>I then try to create a rewrite rule so that requests to <a href="http://mysubdomain.mydomain.com/wiki.php?wiki=WIKIPAGE" target="_blank">mysubdomain.mydomain.com/wiki.php?wiki=WIKIPAGE</a> will be rewritten to <a href="http://mysubdomain.mydomain.com/WIKIPAGE" target="_blank">mysubdomain.mydomain.com/WIKIPAGE</a><br>

<br>Here is the option that i thought would work:<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; server {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; server_name <a href="http://mysubdomain.domain.com" target="_blank">mysubdomain.domain.com</a>;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!-e $request_filename) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rewrite ^/(.*)$ /wiki.php?wiki=$1 last;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br><br>Suggestions to why this does not work are highly appreciated.<br><br>Thanks,<br><font color="#888888">per<br>
</font></blockquote></div><br>