Forum: NGINX wordpress 3.0 wp super cache rewrite rule?

Posted by Max (Guest)
on 2010-08-03 12:30
(Received via mailing list)
Does anyone know the nginx rewrite rule for wordpress 3.0 wp super cache
(multi site)?

I found an example on this site:
http://kuapp.com/2010/06/30/nginx-rewrite-rules-of...

But I am not sure whether this can work with multi site. Thanks a lot.

Max
Posted by Piotr Karbowski (Guest)
on 2010-08-04 11:00
(Received via mailing list)
On 03.08.2010 12:29, Max wrote:
> Does anyone know the nginx rewrite rule for wordpress 3.0 wp super cache
> (multi site)?
>
> I found an example on this site:
> http://kuapp.com/2010/06/30/nginx-rewrite-rules-of...
>
> But I am not sure whether this can work with multi site. Thanks a lot.
>
> Max

Hi,

I have only:

try_files $uri $uri/ /index.php?q=$uri&$args;

and looks like 'wp-super-cache' on mine wordpress3 work flawless, but it
is not wordpress MU, just one blog.

With this rule I was able to set any permalinks type what I want.

-- Piotr.
Posted by Max (Guest)
on 2010-08-04 12:08
(Received via mailing list)
Hi Piotr,

Thanks. I tried your rewrite rule, but it seems it doesn't work with
multisite. I can't see any cache page generated.

Your rewrite rule is interesing, so simple, but as long as it get thing
done, it's ok. I used to use the following rule to make the permalinks
works.

rewrite ^.*/files/(.*)$ /wp-includes/ms-files.php?file=$1 last;
if (!-e $request_filename) {
 rewrite ^.+?(/wp-.*) $1 last;
 rewrite ^.+?(/.*\.php)$ $1 last;
 rewrite ^ /index.php last;
}

Max
Posted by Piotr Karbowski (Guest)
on 2010-08-05 00:45
(Received via mailing list)
On 04.08.2010 12:06, Max wrote:
> Hi Piotr,
>
> Thanks. I tried your rewrite rule, but it seems it doesn't work with
> multisite. I can't see any cache page generated.

You need change something in wp-super-cache for MU if I remember correct
(check readme.txt).

> Your rewrite rule is interesing, so simple, but as long as it get thing
> done, it's ok. I used to use the following rule to make the permalinks
> works.
>
> rewrite ^.*/files/(.*)$ /wp-includes/ms-files.php?file=$1 last;
> if (!-e $request_filename) {
>   rewrite ^.+?(/wp-.*) $1 last;
>   rewrite ^.+?(/.*\.php)$ $1 last;
>   rewrite ^ /index.php last;
> }

Well I not fully understand your 2nd rule, with ! -e but it is working?
You rewritting all requests targeted to non-existing files to 3 others
thing? Last rewrite doing the same thing what nginx's try_files.

I have on the end of my blog (generated page):

<!-- Dynamic page generated in 0.107 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2010-08-04 18:55:06 -->
<!-- Compression = gzip -->

So it's working for me.

-- Piotr.
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.