开发者

Adding subdomain support into lighttpd

开发者 https://www.devze.com 2022-12-15 05:08 出处:网络
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 disp

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/"
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号