1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Problem with rewriting (on lighttpd)

Discussion in 'Server Configuration and Hosting' started by flux, Aug 28, 2011.

  1. flux

    flux Guest

    Hello,

    we have some problems with our Xenforo system on lighttpd:

    Tere is an index.html showing an image rooster in
    • /var/www/domain.com/public_html/

    and XenForo installed to
    • /var/www/domain.com/public_html/community/

    Lighttpd's virtual host for domain.com ist configured as follows (only way to get it working anyway):

    Code:
    $HTTP["host"] =~ "domain.com" {
    
        server.document-root = "/var/www/domain.com/public_html/community/"
        server.dir-listing = "disable"
        dir-listing.hide-dotfiles = "enable"
    
        url.rewrite = (
            "^/(data|install|js|styles)/(.*)$" => "$0",
            "^/(.*\.php)(.*)$" => "$0",
            "^/.*(\?.*)" => "/index.php$1",
            "" => "/index.php"
        )
    }
    The problem is, that if we remove "community/" from the server.document-root var, the rewrite does not work and the index.html not, too. Lighttpd tries to call an index.php in the public_html folder directly, which is not there.

    What shall we do, to fix this problem.

    I've already tried to put the rewrite rule in to
    Code:
    HTTP["url"]="^/community/"
    which isn't working too.

    Someone in the lighttpd forums posted this:
    Code:
    $HTTP["host"] =~ "domain.com" {
        server.document-root = "/var/www/domainname/public_html/"
        server.dir-listing = "disable"
        dir-listing.hide-dotfiles = "enable"
    
        url.rewrite = (
            "^/community/(data|install|js|styles)/(.*)$" => "$0",
            "^/community/(.*\.php)(.*)$" => "$0",
            "^/community/.*(\?.*)" => "/community/index.php$1",
            "^/community" => "/community/index.php"
        )
    }
    which isn't working also.

    Any suggestions/ideas?
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Try this:

    Code:
    HTTP["url"] =~ "^/community/"
    
    For reference:

    http://redmine.lighttpd.net/wiki/1/MigratingFromApache
    http://redmine.lighttpd.net/wiki/lighttpd/Docs:Configuration

    (I don't have a lighttpd server to test this, I am just reading documentation)
     
  3. flux

    flux Guest

    It's been fixed (for a while now). The rewrite rule was correct, but for some case not working. I restarted the webserver several times - which did not apply the changes. force-reload then worked :)
     

Share This Page