Page 1 of 1

webdirs mit lighty und mod_evhost

Posted: 2007-09-16 13:48
by mccab99
Hallo,

Ich nutze mod_evhost, um virtuelle Hosts zu realisieren. Ich möchte gerne, dass

http://subdomain.domain.tld

auf das Verzeichnis

path/to/subdomain_html

und

http://webdir.subdomain.domain.tld

auf das Verzeichnis

path/to/subdomain _data

zeigt. Mein Versuch sieht bisher so aus:

Code: Select all

$HTTP["host"] =~ "webdir" {
    evhost.path-pattern = "/path/to/%3_data"
}

$HTTP["host"] =~ ".domain.tld" {
    evhost.path-pattern = "/path/to/%3_html/"
}
Das klappt aber nicht, da er immer die zweite Regel anwendet. Was mache ich falsch?

Gruß,

Maik

Re: webdirs mit lighty und mod_evhost

Posted: 2007-09-16 14:36
by Joe User

Code: Select all

$HTTP["host"] =~ ".domain.tld" {
    $HTTP["url"] !~ "webdir" {
        evhost.path-pattern = "/path/to/%3_html/"
    }
    $HTTP["url"] =~ "webdir" {
        evhost.path-pattern = "/path/to/%3_data/"
    }
}

Re: webdirs mit lighty und mod_evhost

Posted: 2007-09-16 17:40
by mccab99
Sieht gut aus, klappt aber nicht. Er leitet nach wie vor auf die erste Bedingung um, d.h. trotz "webdir" in der URL geht es ab nach

%3_html

Gruß,

ein ratloser

Maik

Re: webdirs mit lighty und mod_evhost

Posted: 2007-09-16 18:11
by Joe User
Sorry, hatte mich verlesen:

Code: Select all

$HTTP["host"] =~ "^(webdir.|)subdomain.domain.tld$" {
    $HTTP["host"] == "subdomain.domain.tld" {
        evhost.path-pattern = "/path/to/%3_html/"
    }
    $HTTP["host"] == "webdir.subdomain.domain.tld" {
        evhost.path-pattern = "/path/to/%3_data/"
    }
}

Re: webdirs mit lighty und mod_evhost

Posted: 2007-09-16 20:20
by mccab99
Auch hübsch - nur dass dann "subdomain" fest verdrahtet werden muss, das will man bei mod_evhost gerade nicht. Trotzdem war das der Schubs in die richtige Richtung:

Code: Select all

$HTTP["host"] =~ ".domain.tld" {

	$HTTP["host"] =~ ".domain.tld" { 
		evhost.path-pattern = "/path/to/%3_html/"
	}

	$HTTP["host"] =~ "^(webdir.)" { 
		evhost.path-pattern = "/path/to/%3_data/"
    }

}
Das tut jetzt - danke.

Maik