I think the first problem is that you're redirecting to wiki.php instead of to the "/WIKIPAGE" url. As I found out last week, replacing query strings in nginx can be tricky. Does this work? (it won't work with more query string params)<br>
<br>server {<br> if ($query_string ~ ^wiki=(.*)$) {<br> rewrite ^(.*)$ /$1 break;<br> }<br>}<br><br>-tieg<br><br><div class="gmail_quote">On Sun, Mar 9, 2008 at 3:01 PM, Per Hans Hansen <<a href="mailto:pehaha@gmail.com">pehaha@gmail.com</a>> 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 "catch all" 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> server {<br> server_name <a href="http://mysubdomain.domain.com" target="_blank">mysubdomain.domain.com</a>;<br> if (!-e $request_filename) {<br>
rewrite ^/(.*)$ /wiki.php?wiki=$1 last;<br>
}<br> }<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>