Apache, Lighttpd, nginx, Cherokee
mccab99
Posts: 43Joined: 2006-02-20 08:41
Location: Cloppenburg
Post
by mccab99 » 2007-09-16 13:48
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
Joe User
Project Manager
Posts: 11180Joined: 2003-02-27 01:00
Location: Hamburg
Post
by Joe User » 2007-09-16 14:36
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/"
}
}
mccab99
Posts: 43Joined: 2006-02-20 08:41
Location: Cloppenburg
Post
by mccab99 » 2007-09-16 17:40
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
Joe User
Project Manager
Posts: 11180Joined: 2003-02-27 01:00
Location: Hamburg
Post
by Joe User » 2007-09-16 18:11
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/"
}
}
mccab99
Posts: 43Joined: 2006-02-20 08:41
Location: Cloppenburg
Post
by mccab99 » 2007-09-16 20:20
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