Adding subdomain support into lighttpd
I have a lighttpd server with website placed in /home/httpd/example.com/httpdocs and there I have a file called file.php. When I type 开发者_开发技巧http://en.example.com/file.php I would like to display file.php that is in default website directory (mentioned above).
So I used document-root described here:
http://redmine.lighttpd.net/wiki/1/Server.document-rootDetails
in this manner:
$HTTP["host"] =~ "en.example.com/file.php" {
server.document-root = "/home/httpd/example.com/httpdocs/"
}
But unfortunately when I type http://en.example.com/file.php into browser I get error 404. What I do wrong and how can I fix it to work?
In the case of the example URL http://en.example.com/file.php, the host is just en.example.com and not en.example.com/file.php (/file.php is the URL path). So try this:
$HTTP["host"] =~ "en.example.com" {
server.document-root = "/home/httpd/example.com/httpdocs/"
}
精彩评论