The MU forums have moved to WordPress.org

LightTPD URL Rewriting Problem (14 posts)

  1. eviltechie
    Member
    Posted 12 years ago #

    I've installed WPMU 1.2.1 on my server, which runs LightTPD as the web server. I found a post in these forums that gave a LightTPD version of the WPMU url rewriting rules. I installed the URL rewrite rules, and successfully installed WPMU.

    Now, the admin account works. I can access the administration just fine. I can also create new blogs. However, the new blogs don't work right. They can be accessed, but when viewed they show without any style info (just html text). Also, when a user tries to access the admin panel, it gives a 404 error.

    Sample user page: http://blog.helldev.com/nates
    Main page: http://blog.helldev.com

    I'm pretty sure this is a URL rewrite issue, and was hoping someone had some ideas for me. Below is the current URL rewrite in use.

    <code>

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

    </code>

    Any help would be greatly appreciated.

  2. eviltechie
    Member
    Posted 12 years ago #

    Okay, well, I'm not exactly sure how I came to the solution, aside from trying all sorts of rewrite changes, but I've got it working.

    Here's the original code (which DOES NOT work):

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

    And, here is the LightTPD URL rewrite code that DOES WORK!

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

    Hopefully this saves someone else a few hours of frustration. ;-)

  3. eviltechie
    Member
    Posted 12 years ago #

    Minor correction, the main admin wasn't working. The URL rewrite below fixes it.

    =============================

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

  4. Bisente
    Member
    Posted 12 years ago #

    I got it to work by using mod_magnet and this LUA script: wpmu.lua. More info on my blog.
    Please test and report success. I've been testing it just a cople of days and am new to WordPress, so I may be wrong.

  5. drmike
    Member
    Posted 12 years ago #

    Sure would be nice if Donncha stepped in and dropped us a hint since they're running it over at wp.com. :whistle:

  6. donncha
    Key Master
    Posted 12 years ago #

    Not quite - we use Litespeed @ http://litespeedtech.com/
    It supports Apache's mod_rewrite syntax out of the box although I had some difficulties with it myself so I reverted to Apache on my own sites. Sorry I can't be of more help...

  7. drmike
    Member
    Posted 12 years ago #

    Dang it, must not have seen the lite. :)

  8. frozonecold
    Member
    Posted 12 years ago #

    Why does everyone think that Wordpress is powered by lighthttpd? Several other people thought this when lighthttpd was submitted to digg. It must be a conspiracy. ;)

  9. drmike
    Member
    Posted 12 years ago #

    We see the 'lite' :)

    OK, maybe I need to take the day off...

  10. Bisente
    Member
    Posted 12 years ago #

    Found a bug on my LUA script when displaying image files (/file/YEAR/MONTH/...). Please download the fixed version here: wpmu.lua.

    If you experience any problems with this method, please tell me. I'm new to WPMU so I'm stumbling upon problems as I go... :)

  11. jmazzi
    Member
    Posted 12 years ago #

  12. Bisente
    Member
    Posted 11 years ago #

    Hi

    The method at r00tshell.com won't work on two cases:

    - directory based blogs (like in domain.tdl/BLOG). It's designed for standard WordPress, not for WPMU and doesn't take this kind of blogs into account. Should work with WPMU on a domain-based config, thougn. (BLOG.domain.tdl).

    - if you use plugins that make use of query string variables, like jLanguage (appends ?lan=XXXXXX when changing languages). The error-handler-404 redirection doesn't keep the query string vars.

    I've solved the 1st problem with some url.rewrite rules, but still haven't been able to work around the 2nd one. More info here:

    http://www.bisente.com/blog/2007/09/28/lighttpd-and-wordpress-mu-revisited/?lan=english

  13. mrball
    Member
    Posted 11 years ago #

    Added one line as variables after a "?" weren't being picked up. For example, "http://lbandit.lah.cc/page/2/?s=life" would not pick up the search query for 'life'

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

  14. xodeus
    Member
    Posted 10 years ago #

    Hi there. I've been reading all those posts, but most of them are old. So what now? Does wpmu support lighty out of the box?
    If not, what do I have to do to get wpmu fully working? I'm a total noob on self-hosting, so please be very precise on directions.

About this Topic

  • Started 12 years ago by eviltechie
  • Latest reply from xodeus