views:

203

answers:

1

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?

+1  A: 

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/"
}
Gumbo
thank you, do i need to add any dns record to tinydns?
tomaszs