if $request_uri [not static file], then ...

Joe Aston joe at joeaston.com
Sat Nov 8 04:22:18 MSK 2008

How can I achieve the following?

I want to redirect all non-file requests to a script, like this:

          if ($request_uri !~* (js|css|images|etc)$) {
            rewrite ^/(.+)$ /index.php?q=$1 last;

...but this does not work. I do not want to use "if (!-f
$request_filename)" to avoid disk overhead.

Can anyone make a suggestion?


More information about the nginx mailing list