lighttpd 上的 apache .htaccess 文件
RewriteEngine on
RewriteRule ^packed\.js$ pack.php?debug=0 [nc]
RewriteRule ^debug$ pack.php?debug=1 [nc]
这在放置在特定目录中的 .htaccess 文件中的 apache 上运行良好。如果我想在lighttpd上执行此操作,我是否必须将其添加到配置文件或其他内容中?
我需要对这些规则进行任何更改吗?
RewriteEngine on
RewriteRule ^packed\.js$ pack.php?debug=0 [nc]
RewriteRule ^debug$ pack.php?debug=1 [nc]
That worked fine on apache in a .htaccess file placed in a specific directory. If I want to do this on lighttpd, do I have to add it in the config file or something?
Would I need to make any changes to these rules?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
lighttpd 不像 Apache httpd 那样支持
.htaccess
文件。这就是“lighttpd”中的“光”发挥作用的地方。但是,您可以将这些规则从 Apache httpd 的 mod_rewrite 迁移到 lighttpd 的 < a href="http://redmine.lighttpd.net/wiki/1/Docs:ModRewrite" rel="noreferrer">mod_rewrite。但请注意,lighttpd 的 mod_rewrite不支持
NC
标志(不区分大小写的匹配)。如果没有它,您可以简单地使用以下重写规则:如果您需要匹配不区分大小写,您可能需要调用 mod_magnet 和自定义 Lua 脚本。
lighttpd doesn't support
.htaccess
files like Apache httpd does. That's where the "light" in "lighttpd" comes into play.You can, however, migrate these rules from Apache httpd's mod_rewrite to lighttpd's mod_rewrite. But be aware that the
NC
flag (case-insensitive matching) is not supported by lighttpd's mod_rewrite. If you are fine without it, you could simply use the following rewrite rules:If you need the match to be case-insensitive, you'll probably need to invoke mod_magnet and a custom Lua script.