使用新文档根重写 lighttpd 规则将不起作用
我有
server.document-root = "/srv/www"
一些静态文件,但我想使用另一个文档根目录。我尝试使用此代码:
$HTTP["url"] =~ "^/hg/static" { url.rewrite-once = ("^/hg/static" => "/") server.document-root = "/usr/lib/python2.6/site-packages/mercurial/templates/static/" }
但在 error.log 中出现错误:
2011-10-13 12:00:16: (/response.c.539) -- file not found 2011-10-13 12:00:16: (/response.c.540) Path : /usr/lib/python2.6/site-packages/mercurial/templates/static/hg/static/style-coal.css
尝试时:
$ wget http://localhost/hg/static/style-coal.css
请求文件的真实路径为 /usr/lib/python2.6/site-packages/mercurial/templates /static/style-coal.css 但服务器尝试找到 /usr/lib/python2.6/site-packages/mercurial/templates/static/hg/static/style -煤炭.css
I have
server.document-root = "/srv/www"
but for some static files I want use another document-root. I try use this code:
$HTTP["url"] =~ "^/hg/static" { url.rewrite-once = ("^/hg/static" => "/") server.document-root = "/usr/lib/python2.6/site-packages/mercurial/templates/static/" }
but I get error in error.log:
2011-10-13 12:00:16: (/response.c.539) -- file not found 2011-10-13 12:00:16: (/response.c.540) Path : /usr/lib/python2.6/site-packages/mercurial/templates/static/hg/static/style-coal.css
when try:
$ wget http://localhost/hg/static/style-coal.css
Real path to requested file is /usr/lib/python2.6/site-packages/mercurial/templates/static/style-coal.css but server try locate /usr/lib/python2.6/site-packages/mercurial/templates/static/hg/static/style-coal.css
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我使用别名来解决这个问题:
但仍然不明白如何用 mod_rewrite 来解决这个问题...
I use alias to resolve this problem:
but still don't understand how archieve this with mod_rewrite...