【问题标题】:Adding subdomain support into lighttpd将子域支持添加到 lighttpd
【发布时间】:2009-12-29 19:58:47
【问题描述】:

我有一个 lighttpd 服务器,其网站放置在 /home/httpd/example.com/httpdocs 中,并且我有一个名为 file.php 的文件。当我输入 http://en.example.com/file.php 时,我想显示默认网站目录(如上所述)中的 file.php

所以我使用了此处描述的文档根:

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。我做错了什么以及如何修复它以使其正常工作?

【问题讨论】:

    标签: dns webserver subdomain lighttpd


    【解决方案1】:

    对于示例 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/"
    }
    

    【讨论】:

      猜你喜欢
      • 2020-09-13
      • 2010-11-08
      • 1970-01-01
      • 2013-10-01
      • 2016-05-26
      • 1970-01-01
      • 2016-02-27
      • 2011-04-07
      • 1970-01-01
      相关资源
      最近更新 更多