gavenkoa
gavenkoa

Reputation: 48753

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/static/hg/static/style-coal.css

Upvotes: 1

Views: 714

Answers (1)

gavenkoa
gavenkoa

Reputation: 48753

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...

Upvotes: 2

Related Questions