Problem with simple rewrite rule

Per Hans Hansen pehaha at gmail.com
Sun Mar 9 22:01:44 MSK 2008


I try to create a very simple rewrite rule with nginx, but i doesnt work.

I have set up my server with a "catch all" server_name *.mydomain.com

I then try to create a rewrite rule so that requests to
mysubdomain.mydomain.com/wiki.php?wiki=WIKIPAGE will be rewritten to
mysubdomain.mydomain.com/WIKIPAGE

Here is the option that i thought would work:

       server {
             server_name mysubdomain.domain.com;
             if (!-e $request_filename) {
             rewrite ^/(.*)$ /wiki.php?wiki=$1 last;
             }
        }

Suggestions to why this does not work are highly appreciated.

Thanks,
per
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20080309/5867b19b/attachment.html>


More information about the nginx mailing list