在lighttpd的apache的.htaccess文件 [英] apache .htaccess file on lighttpd

查看:219
本文介绍了在lighttpd的apache的.htaccess文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

RewriteEngine on
RewriteRule ^packed\.js$ pack.php?debug=0 [nc]
RewriteRule ^debug$ pack.php?debug=1 [nc]

在放置在一个特定的目录中的.htaccess文件工作的罚款在Apache。如果我想这样做的lighttpd的,我必须把它添加在配置文件什么的?

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?

推荐答案

的lighttpd不支持的.htaccess 文件像Apache httpd的一样。这就是在lighttpd的光来发挥作用。

lighttpd doesn't support .htaccess files like Apache httpd does. That's where the "light" in "lighttpd" comes into play.

您可以,但是,来自Apache httpd的的 mod_rewrite的这些规则迁移到lighttpd的的 mod_rewrite的。但要知道,在 NC 标志(不区分大小写匹配)是的没有的通过的lighttpd的mod_rewrite支持。如果你是罚款,没有它,你可以简单地使用下面的重写规则:

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:

url.rewrite-once = (
    "^packed\.js$"  => "pack.php?debug=0",
    "^debug$" => "pack.php?debug=1" 
)

如果您需要匹配是不区分大小写的,你可能需要调用 mod_magnet 和一个自定义的Lua脚本。

If you need the match to be case-insensitive, you'll probably need to invoke mod_magnet and a custom Lua script.

这篇关于在lighttpd的apache的.htaccess文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆