2009-12-29 59 views
1

我有一个网站的lighttpd服务器放置在/home/httpd/example.com/httpdocs有我有一个名为file.php文件。当我输入http://en.example.com/file.php我想显示file.php这是默认的网站目录(如上所述)。添加子域名支持到lighttpd的

所以我这里使用的描述文档根:

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到浏览器中,我得到错误404.我做错了,我该如何解决它的工作?

回答

2

在该示例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/" 
} 
+0

谢谢,我是否需要添加任何dns记录到tinydns? – 2009-12-29 21:30:47