在lighttpd中添加子域支持
我有一个 lighttpd 服务器,其网站位于 /home/httpd/example.com/httpdocs 中,并且有一个名为 file.php 的文件。当我输入 http://en.example.com/file.php< /em> 我想显示默认网站目录中的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。我做错了什么以及如何修复它以使其正常工作?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于示例 URL http://en.example.com/file.php< /a>,主机只是 en.example.com 而不是 en.example.com/file.php (/file.php 是 URL 路径)。所以试试这个:
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: