开发者

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

开发者 https://www.devze.com 2023-04-12 13:16 出处:网络
I have server.document-root = \"/srv/www\" but for some static files I want use another document-root. I try use this code:

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

精彩评论

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

关注公众号