Lighttpd 重写 Codeigniter 在某些 URL 上崩溃
我从 apache 迁移到 lighttpd,从那时起,某些 URL 破坏了重写并给出 404。access.log、error.log 中没有关于实际命中的 URL 的详细信息。
这些工作: http://192.168.1.250/loop/rest/admin
但不是这些: http://192.168.1.250/loop/ rest/admin/logs/file::log-2012-02-14.php
如果我跳过重写并使用 http://192.168 .1.250/loop/rest/index.php?/admin/logs/file::log-2012-02-14.php
我得到了我想要的,
在这里是我的重写规则:
url.rewrite-once = (
"/(.*)\.(.*)" => "$0",
"/(css|files|img|js|stats)/" => "$0",
"^/([^.]+)$" => "/loop/rest/index.php/$1"
)
任何帮助将不胜感激。
I moved from apache to lighttpd, and since then certain URLs break the rewriting and give 404. No details in access.log, error.log regarding what actual URL was hit.
These kind work:
http://192.168.1.250/loop/rest/admin
But not these:
http://192.168.1.250/loop/rest/admin/logs/file::log-2012-02-14.php
If I skip rewriting and use
http://192.168.1.250/loop/rest/index.php?/admin/logs/file::log-2012-02-14.php
I get what I want,
Here is my rewrite rule:
url.rewrite-once = (
"/(.*)\.(.*)" => "$0",
"/(css|files|img|js|stats)/" => "$0",
"^/([^.]+)$" => "/loop/rest/index.php/$1"
)
Any help would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我在 lighttpd 上测试我的 codeigniter 应用程序时遇到了同样的问题
这对我有用:
也许你可以尝试这个设置:
确保你在顶部有未注释的 mod_rewrite ..它默认在前面有一个 # 。
I was just having the same issues when testing my codeigniter app on lighttpd
This worked for me:
maybe you could try this for your setup:
Make sure you have uncommented mod_rewrite at the top.. it comes default with a # in front of it.
我找到了正确的规则:
首先请确保您的根指令指向您的 CI 设置的根目录。
那么这个位置指令就可以完美地工作:
I have found the correct rules:
First of all please make sure that your root directive points to the root of your CI setupd.
Then this location directive will work perfectly fine: