Lighttpd 中的 Apache AllowOverride 等效项
我已将 .htaccess 文件放入 lighttpd 网站的主目录中,如下所示:
url.rewrite-once = (
"^/cat.php$" => "index.php"
)
我已在 lighttpd.conf 中启用 mod_rewrite 和 mod_redirect 并重新启动 lighttpd 服务器。
但不幸的是,当我输入 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Lighttpd 不支持 .htaccess 文件 - http ://redmine.lighttpd.net/projects/lighttpd/wiki/FrequentlyAskedQuestions#Do-you-support-htaccess-files
Lighttpd doen't support .htaccess files - http://redmine.lighttpd.net/projects/lighttpd/wiki/FrequentlyAskedQuestions#Do-you-support-htaccess-files
Lighttpd 确实不支持 .htaccess 文件,您必须将其添加到 lighttpd.conf 文件中。
例如,
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
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.