Lighttpd 中的 Apache AllowOverride 等效项

发布于 2024-08-16 06:51:15 字数 414 浏览 4 评论 0原文

我已将 .htaccess 文件放入 lighttpd 网站的主目录中,如下所示:

url.rewrite-once = ( 
  "^/cat.php$" => "index.php"
)

我已在 lighttpd.conf 中启用 mod_rewrite 和 mod_redirect 并重新启动 lig​​httpd 服务器。

但不幸的是,当我输入 mydomain/cat.php 时,我收到错误页面 404。

我发现在 Apache 中需要写入:

<Directory />
AllowOverride All
</Directory> 

在配置文件中。但我找不到 Lighttpd 的等效设置。这是什么?

I've put a .htaccess file in my main directory of my lighttpd website like this:

url.rewrite-once = ( 
  "^/cat.php$" => "index.php"
)

And I have enabled mod_rewrite and mod_redirect in my lighttpd.conf and restarted lighttpd server.

But unfortunately when i type mydomain/cat.php i got error page 404.

I've found that in Apache there is necessery to write:

<Directory />
AllowOverride All
</Directory> 

In config file. But I can not find equivalent of this setting for Lighttpd. What is this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

荒岛晴空 2024-08-23 06:51:15

Lighttpd 确实不支持 .htaccess 文件,您必须将其添加到 lighttpd.conf 文件中。

例如,

$HTTP["host"] == "www.example.com" {
    server.document-root = "/var/www/example.com/wwwroot/"
    url.rewrite-once = ( 
        "^/cat.php$" => "index.php"
    )
}        

Lighttpd 是一个轻量级服务器,因此它不具备 apache 的所有厨房水槽功能。也就是说,您可以用不同的方式完成 apache 中可以做的大部分事情。

Its true that Lighttpd doesn't support .htaccess files, you will have to add this to the lighttpd.conf file.

For example

$HTTP["host"] == "www.example.com" {
    server.document-root = "/var/www/example.com/wwwroot/"
    url.rewrite-once = ( 
        "^/cat.php$" => "index.php"
    )
}        

Lighttpd is a light weight server so it doesn't have all of the kitchen sink like feature of apache. That said you can do most of what you can do in apache just in a different way.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文