1

/home/httpd/example.com/httpdocsにWebサイトが配置されたlighttpdサーバーがあり、 file.phpというファイルがあります。http://en.example.com/file.phpと入力すると、デフォルトのWebサイトディレクトリ(上記)にあるfile.phpを表示したいと思います。

そこで、ここで説明する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と入力すると、エラー404が発生します。何が間違っているのでしょうか。どうすれば修正できますか。

4

1 に答える 1

2

サンプルURLhttp: //en.example.com/file.phpの場合、ホストはen.example.com/file.phpではなくen.example.comです/file.phpはURLパスです) )。だからこれを試してみてください:

$HTTP["host"] =~ "en.example.com" {
    server.document-root = "/home/httpd/example.com/httpdocs/"
}
于 2009-12-29T20:31:32.260 に答える