WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Rewrite rule for lighttpd (2 posts)

  1. danielvijge
    Member
    Posted 4 years ago #

    I was using WordPress MU 2.9 on a lighttpd web server. I'm using subdomains for every blog. I had a working rewrite rule configured as:

    server.error-handler-404 = "/index.php"
    url.rewrite-once = (
        "^/(.*/)?files/$" => "/index.php",
        "^/(.*/)?files/(.*)" => "/wp-content/blogs.php?file=$2",
        "^(/wp-admin/.*)" => "$1",
        "^/([_0-9a-zA-Z-]+/)?(wp-.*)" => "/$2",
        "^/([_0-9a-zA-Z-]+/)?(.*\.php)$" => "/$2",
    )

    Now I've installed WordPress 3.0 with multisite enabled. The rewrite rule doesn't work for permalinks that do not include /index.php/. I've already changed the blogs.php to the new ms-files.php, and images are loaded without a problem.
    However, loading http://sub.domain.com/page will go to http://domain.com Also, what I've noticed is that http://sub.domain.com/index.php is redirected to http://sub.domain.com, even without any rewrite rules. Not sure why WordPress does that, or if that causes the rewrite rules to fail.

    Anyone got permalinks in WordPress 3 with multisite working on Lighttpd?

  2. danielvijge
    Member
    Posted 4 years ago #

    Yeah, solved it. The problem was not in the rewrite rules, but in the wp-config file. Both these must by in the config file:

    // enable multisite
    define('MULTISITE', true);
    
    // multisite for sub domains
    define('SUBDOMAIN_INSTALL', true);

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.