将子域支持添加到lighttpd [英] Adding subdomain support into lighttpd
问题描述
所以我使用了document-root在此描述:
http://redmine.lighttpd.net/wiki/1/Server.document-rootDetails
以这种方式:
$ HTTP [host] =〜en.example.com/file.php{
server.document-root =/ home /httpd/example.com/httpdocs/
}
但不幸的是,当我键入 http://en.example.com/file.php into浏览器我得到错误404.我做错了,我该如何解决它的工作?
在示例的情况下URL http://en.example.com/file.php ,主机只是 en。 example.com 而不是 en.example.com/file.php ( /file.php 是URL路径)。所以尝试这样:
$ HTTP [host] =〜en.example.com{
server .document-root =/home/httpd/example.com/httpdocs/
}
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/"
}
这篇关于将子域支持添加到lighttpd的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!