Project

General

Profile

URL condition and URL rewrite in same HOST condition?

Added by simonlange almost 11 years ago

Hi,

lighttpd/1.4.30 (ssl) - a light and fast webserver
Build-Date: Mar 23 2012 12:16:11

Event Handlers:

        + select (generic)
        + poll (Unix)
        - rt-signals (Linux 2.4+)
        + epoll (Linux 2.6)
        - /dev/poll (Solaris)
        - eventports (Solaris)
        - kqueue (FreeBSD)
        - libev (generic)

Network handler:

        + sendfile

Features:

        + IPv6 support
        + zlib support
        + bzip2 support
        + crypt support
        + SSL Support
        + PCRE support
        + mySQL support
        - LDAP support
        - memcached support
        + FAM support
        + LUA support
        - xml support
        - SQLite support
        - GDBM support

$HTTP["host"] =~ "^domain.de" {
        server.name             = "domain.de" 
        server.document-root    = "/var/www/domain/htdocs/" 
        accesslog.filename      = "/var/log/lighttpd/domain-access.log" 
        server.errorlog         = "/var/log/lighttpd/domain-error.log" 
        server.indexfiles       = ( "index.php", "index.html" )
        fastcgi.server = ( ".php" =>
                  ( "localhost" =>
                    ( "host"        =>     "127.0.0.1",
                      "port"        =>     1026,
                    )
                  )
        )
        $HTTP["url"] =~ "^/etherpad(.*)$" {
                proxy.server = ( "" => (( "host" => "127.0.0.1", "port" => 8081 )) )
                setenv.add-response-header = ( "Via" => "1.1 domain.de:80/etherpad (lighttpd)" )
        }
        url.rewrite = (
                "^/wp-admin/$" => "/wp-admin/$1",
                "^/(.*)\.(.+)$" => "$0",
                "^/(.+)/?$" => "/index.php/$1" 
        )
        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",
        )
}

Problem: The site itself (wordpress 3.5.2) runs perfectly but im not able to reach the urlcondition with the proxy-statement.

any chance that it will first check the url conditions and then doin the rewrites?
or any other idea who to get both working together?(rewrites and the url conditions)

any help would be great. ;)

Simon

PS: