开发者

Rewrite rules for lighttpd with new document-root would not work

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/sta开发者_C百科tic/hg/static/style-coal.css


I use alias to resolve this problem:

alias.url = ( "/hg/static" => "/usr/lib/python2.6/site-packages/mercurial/templates/static/" )

but still don't understand how archieve this with mod_rewrite...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜