lighthttp 的 mod_rewrite 问题
我正在将 mod_rewrite 与 lighttpd 一起使用,并且遇到了问题...
这是我的规则:
url.rewrite-once = (".*\.(js|ico|gif|jpg|png|css)$" => "$0", "" => "/index.php")
apache 规则适用于 apache,看起来像这样:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule !\.(js|ico|gif|jpg|png|css)$ /index.php
它工作得很好,除了当我想使用 phpmyadmin 时, http://www.site.com/phpmyadmin 当然会被重定向到我告诉它的地方......但是,我真的希望它能够处理真实的目录和文件。
如何更改 lighttpd 中的重写规则以尊重 /phpmyadmin 等内容?
编辑:
查看所有内容并进行一些研究,我缺少这些行的lighttpd 等效项:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
How can I add those to thelighttpd rewrite config?
I am using mod_rewrite with lighttpd, and I am having an issue...
Here is my rule:
url.rewrite-once = (".*\.(js|ico|gif|jpg|png|css)$" => "$0", "" => "/index.php")
The apache rule works on apache, and looks like this:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule !\.(js|ico|gif|jpg|png|css)$ /index.php
It works perfectly, except, when I want to use phpmyadmin, http://www.site.com/phpmyadmin is of course being redirected to where I am telling it to... however, I would really like it to work with real directories and files.
How can I change the rewrite rule in lighttpd to respect things such as /phpmyadmin?
Edit:
Looking over everything and doing some research, I am missing the lighttpd equivilent of these lines:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
How can I add these to the lighttpd rewrite config?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
经过大量的折腾、阅读和许多其他艰苦的事情之后,我想出了这个,我希望它能帮助其他人解决我遇到的同样的问题......
所以:
http://www.site.com/class/method/test/ 1/test2/2(将按预期工作)
http://www.site.com/phpmyadmin/ (将按预期工作 - 注意尾部斜杠)
After a lot of messing around, reading, and many other painstaking things, I came up with this, and I hope it helps everyone else with the same problem I had...
So:
http://www.site.com/class/method/test/1/test2/2 (WILL WORK AS EXPECTED)
http://www.site.com/phpmyadmin/ (WILL WORK AS EXPECTED - note trailing slash)