Help with nginx rewrite rules for WordPress MU

  • Unknown's avatar

    Hello,

    I have setup a WordPress MU blog as http://www.domain.com/blog on nginx.
    Everything works fine except the rewrite rules.

    The apache rules for WP MU I was using are:
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /blog/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /blog/index.php [L]
    </IfModule>

    The nginx rules I am using currently are :

    location /blog/ {
    if (!-e $request_filename) {
    rewrite ^.+?(/.*.php)$ /blog$1 last;
    rewrite ^.+?(/wp-.*) /blog$1 last;
    rewrite ^ /blog/index.php last;
    }
    }

    Now although the URLs work properly my page design gets screwed up. The sidebar goes to the bottom and design gets weird. On removing these rules the page deisgn is fine but individual posts give a 404 error.
    What is wrong with the my nginx rewrite rules?

  • Unknown's avatar

    You did not specify a blog address or reason for posting when you created this topic.

    This support forum is for WordPress.com hosted blogs only. If you have a self-hosted WordPress blog you need to seek help at the WordPress.org forums, not here.

    If you don’t understand the difference, you may find this information helpful.

  • The topic ‘Help with nginx rewrite rules for WordPress MU’ is closed to new replies.