2013-03-13 215 views
1

我使用Lighttpd Web服务器与PHP结合使用。Lightttpd文档根目录:将默认页面从index.php更改为xyz.php

我想弄清楚如何更改默认行为,以便浏览到"www.domain.com"将加载xyz.php而不是index.php;这两者都在doc根目录中。

我能够将重定向添加到lighttpd,以便将"www.domain.com/index.php"的请求成功重定向到"www.domain.com/xyz.php"。我不知道如何让"www.domain.com""www.domain.com/xyz.php"

谢谢你的时间。

+0

我也使用别名尝试:“/索引。 php“=> document_root +”/xyz.php“ 但这并没有帮助。 – toskers 2013-03-13 20:11:37

回答

1

你试过:

url.redirect = (
      "^/$" => "http://www.domain.com/xyz.php" 
    ) 
+0

谢谢@ j0k,工作! – toskers 2013-03-14 20:07:18

0

您可以更改lighttpd.conf中的index-file.names设置。

index-file.names = (
    "xyz.php", "index.php", "index.html" 
) 

在上面的例子中,以一个http://www.example.com/请求将第一服务xyz.php如果它存在,如果不index.php和如果既没有文件存在index.html